what is the difference between using Place_meeting or the built in collision event?

M

Matthew Imamura

Guest
When I watch tutorials online, most of them uses the "Place_meeting" variable. but I saw a built in collision when creating events so I experimented with that. they both seem to do the same thing. I was wondering if there was a difference between the two and in what situation will one be better than the other?
 

Slyddar

Member
There are various reasons why you would want one over the other, both have their uses.

The collision event will run after all the instances step events have taken place, and the instances have moved via their in-built speed variables, but before the end step event.

The place_meeting code can be run in the step event when you want it, so it gives you more control. You can also run place_meeting to predict a collision by using x/y+speed like variables, so you can test if a collision will happen this step, where as the collision event will only trigger when the collision actually happens, so any code in the step event relying on the collision, will run the next step.

If the timing of those things don't matter, or you don't care about controlling what happens, then a collision event is fine to use.

Also if you use a state machine, it might be painful to have place_meeting checks in each state, where as a collision event doesn't care and will run no matter what state, or code is in the instances step event.
 
Last edited:

TsukaYuriko

☄️
Forum Staff
Moderator
Apart from what @TheSky already mentioned, the technical differences also include that with place_meeting, you can specify an instance ID rather than an object ID to check for collisions with.

The Collision event trades functionality for a gain in convenience, while place_meeting trades convenience for a gain in functionality.
 
Top