set angle away from position

Get help using Construct 2

» 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
26
S
7
G
5
Posts: 185
Reputation: 5,086

» 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
28
S
8
G
5
Posts: 429
Reputation: 7,007

» 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

» Sat Dec 29, 2012 5:44 pm

Can you invert set the angle action? That might be s simple way to do it.
www.h1k3.tech

We are here for you!
B
92
S
24
G
16
Posts: 716
Reputation: 17,092

» 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
48
S
15
G
7
Posts: 603
Reputation: 8,246

» 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
26
S
7
G
5
Posts: 185
Reputation: 5,086