Page 1 of 1

Check colission within script

PostPosted: Tue Oct 31, 2006 1:22 am
by EvilDragon
I have a small question.

I have a key-down event (Script Editor).

Now, within this script, there are certain parts that should ONLY be executed, if the object collides with a certain other object.

How can I find this out?

Thanks!

PostPosted: Tue Oct 31, 2006 2:34 am
by makslane
You can try use the function getAllActorsInCollision or use variables to track the collision state in the events 'Collision' and 'Collision Finish'

More info:
http://game-editor.com/docs/script_refe ... ncollision
http://game-editor.com/examples/collisiongroups.zip
(run and use right click to catch the actors)

PostPosted: Tue Oct 31, 2006 4:57 am
by DilloDude
The other option would be to make a variable 'colliding', and on a collision set it to 1, and on collision finish, set it to 0. Then just check the variable.