Instance_position checks self

D

Drepple

Guest
So I'm currently working on a game with an object called obj_bolt in it that checks for obj_gate right in front of it using instance_position(x-64,y,obj_gate). However, obj_bolt is a child of obj_gate, so whenever I try to get the id of the gate object, obj_bolt will return it's own id. (Pretty sure it's because obj_gate is its parent).

So is there a way in which obj_bolt checks for the gate instance's id without giving me its own id?

Thanks in advance
 

FrostyCat

Redemption Seeker
Why is obj_bolt a child of obj_gate? The child-parent relationship for objects is an "A is a kind of B" relationship, not an "A uses B" or "A is a part of B" relationship. Instead of trying to make instance_position() ignore the relationship, the more sensible thing to do is to cut the relationship.
 
D

Drepple

Guest
it has no be there. I've found something that could work, it's collision_point(), but does this work exactly the same as position_meeting apart from the prec and the notme arguments?
 
D

Drepple

Guest
never mind, it was a glitch. I copied the code, removed it and pasted it back in and now it works fine...
 
Top