Legacy GM Collision Depth?

A

acrouzet

Guest
I'm wondering if there is a way to make an object not collide with another object when there is an object between the two.

For example, say I have an object with a depth of -2, and an action will occur when that object collides with another object with a depth of 1. Is it possible for the action to not occur when there is an object with a depth of -1 on top of the depth 1 object?
 

TheouAegis

Member
Collision event:
var col = other.id;
var blocked = false;
with all if id!=other.id && id!=col.id
if position_meeting(col.x,col.y,id) && median(depth,other.depth,col.depth) == depth
blocked = true;
if blocked
{
}
else
{
}
 
A

acrouzet

Guest
Collision event:
var col = other.id;
var blocked = false;
with all if id!=other.id && id!=col.id
if position_meeting(col.x,col.y,id) && median(depth,other.depth,col.depth) == depth
blocked = true;
if blocked
{
}
else
{
}
Which object am I supposed to apply this to?
 
Top