object collision


(chacademus) #1

Anyone know how to find out what object, another one with a python script attached, collides with? Im trying to use the getHitObjectList command but having no luck!


(Ben) #2

-Try with getHitObject().Anyway getHitObjectList() must work.


(saluk) #3

If you use getHitObjectList(), then it returns a list which you must scan through to find the object you want. If you are confused about lists, or for loops, check out python.org.

getHitObject() will return the first object the collision sensor sees, this isn’t necesarily the closest object.