Skip to main content
minor formatting improvement
Source Link
Ray Mairlot
  • 29.4k
  • 12
  • 105
  • 126

Is there a way to determine which object has been detected with the sensor? For example, if the owner's collisions sensor turns positive, is it possible to get the object collided with?

Something like this: if own.collisionSensor.positive: obj1 = owner of detected collision object (print obj1) Many thanks in advance for any help!!

if own.collisionSensor.positive:
   obj1 = owner of detected collision object
   (print obj1)

Is there a way to determine which object has been detected with the sensor? For example, if the owner's collisions sensor turns positive, is it possible to get the object collided with?

Something like this: if own.collisionSensor.positive: obj1 = owner of detected collision object (print obj1) Many thanks in advance for any help!!

Is there a way to determine which object has been detected with the sensor? For example, if the owner's collisions sensor turns positive, is it possible to get the object collided with?

Something like this:

if own.collisionSensor.positive:
   obj1 = owner of detected collision object
   (print obj1)
Source Link

Determining the object detected in sensor

Is there a way to determine which object has been detected with the sensor? For example, if the owner's collisions sensor turns positive, is it possible to get the object collided with?

Something like this: if own.collisionSensor.positive: obj1 = owner of detected collision object (print obj1) Many thanks in advance for any help!!