Get instance's angle from another instance?

Get help using Construct 2

Post » Wed Oct 22, 2014 10:12 pm

Is there a way to get object's angle from another? I need this to make a system that could push overlapping objects away from each other. Tried using the "angle" expression, but it can't seem to get coordinates from two of same object. For example my object is called Enemy_Hitbox, so the command would be: angle(Enemy_Hitbox.X, Enemy_Hitbox.Y, Enemy_Hitbox.X, Enemy_Hitbox.Y,)

Since both of the objects overlap each other, the command gets only one angle and then pushes both of them into same direction and that's not what I want.
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Wed Oct 22, 2014 11:23 pm

You can index objects. This is a bit easier with Families.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
21
G
233
Posts: 3,696
Reputation: 130,368

Post » Thu Oct 23, 2014 12:48 am

Hmm. I'm using a ton of enemies that are all supposed to repel each other. How can I make this work with more than one UID?
B
21
S
7
G
4
Posts: 233
Reputation: 3,474


Return to How do I....?

Who is online

Users browsing this forum: atmas and 19 guests