Collision with a specific object?

(Tonberry) #1

Hi (me again!) :slight_smile:

How do I set up in blenders game engine so a collision with object A on object B can be stored and counted somewhere?

I have tried to use the CollisionSensor but I don’t understand the Property I have to write… and where can I count the number of times Object A has collided with object B?? Must I use Python for that?

Oh… so many questions and so little knowledge… :frowning:

(OTO) #2


there’s different ways to do that!!
Here’s one:

Inobject A add a Int property, name it count, and press the little D button!
Add a Collision sensor with in the M/P (Material or Property, it’s up to you to choose) field the ponk name. Link this to an Property Actuator with ADD -
count in the property field and 1 in the value field.
Now when object A collides with an object with Material/Proprty ponk in it
the count property will add 1 value.
Select object B and give to him a Material or a property named ponk

That’s all. Now in the game menu enable Show debug.
When you play, you’ll see the count name and value in the top left corner.
Is this clear?


(Tonberry) #3

Thanx!! That helped! :slight_smile:

Thought about if it is a difference which object that has the collision sensor? My two object are (for now) a Cube and a Wall. It seems logic to put the Collision Sensor on the Cube (because it collides with the Wall)… But… uhm… guess it is only a matter of which reference system i use… lol! :slight_smile:

Thanx again! :slight_smile: