however as soon as i touch the object in question the message appears but the game freezes and i cant do anything at all i tried taking out the return and changing it to 0 but nothing works any ideas please.
however as soon as i touch the object in question the message appears but the game freezes and i cant do anything at all i tried taking out the return and changing it to 0 but nothing works any ideas please.
[/quote]
ermmm you're kinda going about that the wrong way. Use CollideObject_*_*() instead:
uhhhhh.... you can't call messages from an update room function...
this is why:
the update room function runs about 37 times *every second*, so anything that requires player input is not going to work, because by the time the player has responded, it's already called that bit of code again about 30+ times. Hence the game freezing when you tried it.
You can't have anything *at all* that pauses the code (such as WaitFrames) in an update_room function, or any similar function that is called all the time.
I don't actually understand why you'd have a collide function inside an update room function? surely if you want it to do something on collision, you'd want it to do it anytime you collided with it? if not, just set the collide property to 0 when you don't want to be able to collide with it
CollideObject_*_*() would do that fine, without the need for an updateroom function to do it.
Thanks :smile: Oh whats the meaning of 2000_1 i assume 2000 is the object number but whats the 1 for?
[/quote]
the 1 is the collision type.
imagine you have a huge tile for colliding with.
0 is exiting from colliding with it 1 is entering colliding with it 2 is continuing to collide with it (e.g. jumping through a flame or hitting a baddie)
use 1 if you only want it to run the code once, use 2 if you want it to run the code all the time while in front of the object, and use 0 if you don't want the code to run until you stop colliding with it.