This action is used to check and see if there is a collision with an instance of a given object. You give the object to check for, the position - which can be an absolute position or a position relative to the instance - and the action will return true if there is a collision or false if there is not. You can also check the "Not" flag to check if there is not a collision at the given position, and the action will then return true if no collisions are found and false otherwise. Collisions are calculated based on the collision mask of the calling instance overlapping the collision mask of the instance or object being checked for (as if it was being "placed" at the position).IMPORTANT! Collisions will only register for those instances that have a valid collision mask, ie: they have a sprite assigned to the sprite_index, or a sprite assigned to the mask_index. If either of the instances in the collision have no collision mask then the collision will not be detected, regardless of what the instance is drawing at the time.
Note that to add actions into an "if" block, they should be dropped to the side of the action, as shown in the image below:
Argument Description Object The object to check for instances of x The x position to check y The y position to check
The above action block code checks for a collision with any instances of the object "obj_Wall" to the left and to the right and if one is found it reverses the horizontal direction of the calling instance.