Check colission within script

Non-platform specific questions.

Check colission within script

Postby EvilDragon » Tue Oct 31, 2006 1:22 am

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!
Cheers,
EvilDragon.

http://www.gp2x.de
EvilDragon
 
Posts: 10
Joined: Sat Sep 23, 2006 11:10 am
Score: 0 Give a positive score

Postby makslane » Tue Oct 31, 2006 2:34 am

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)
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby DilloDude » Tue Oct 31, 2006 4:57 am

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.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest