set angle away from position

Get help using Construct 2

Post » Sat Dec 29, 2012 1:31 pm

In the events you can set angle toward a position, but can anyone tell me how to do the opposite, to set angle away from a position.
B
25
S
7
G
5
Posts: 185
Reputation: 5,056

Post » Sat Dec 29, 2012 1:37 pm

Not sure if this is exactly what you're after. but:

To make the angle of the player point towards something you can do this: Set angle > angle(player.x,player.y,desiredangle.x,desiredangle.y). To make it go in the opposite direction, simply swap the places of the player.X/Y with the desiredangle.X/Y.

So: angle(desiredangle.x,desiredangle.y,player.x,player.y)
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Post » Sat Dec 29, 2012 3:04 pm

If you have an angle in degrees, the opposite of that angle can be represented as Angle-180. (or +180)Nimtrix2012-12-29 15:06:15
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Dec 29, 2012 5:44 pm

Can you invert set the angle action? That might be s simple way to do it.
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Sat Dec 29, 2012 5:56 pm

Theres an action that sets an object towards another object, just do that then subtract 180 from its angle.
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Wed Jan 02, 2013 12:20 pm

Hi, I tried those, but annoyingly it doesnt seem to work perfectly, also I found soem other issues with what I was trying to do so have opted for a simplified version with less issues.
B
25
S
7
G
5
Posts: 185
Reputation: 5,056


Return to How do I....?

Who is online

Users browsing this forum: mercuryus and 17 guests