imgur.com/juXgwHH
I want to do angle(objPlayer.x, objPlayer.y, objPlayer.x, objPlayer.y)
angle(objPlayer.x, objPlayer.y, objPlayer.x, objPlayer.y)
So the underlined part is the first player who collided into the other, and not underlined is the victim.
What is the best way to choose instances mid event?
In a collision or overlap event you can make use of system Pick nth instance, where instance 0 and instance 1 are the two involved in the event.
Develop games in your browser. Powerful, performant & highly capable.
But how do I use this in an expression?
Such as? When you collide you can pick out the two instances using what I mentioned and then whenever you reference the object it is referring to the one picked.
angle(objPlayer(0).X, objPlayer(0).Y, objPlayer(1).X, objPlayer(1).Y)
If you have many instances of this object it may be handy to create a family with this object. Then you can refer to two different instances in the same event like this:
Object on collision with ObjectFamily ... angle (Object.x, Object.y, ObjectFamily.x, ObjectFamily.y)
This helps, thank you!