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

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

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.
www.h1k3.tech

We are here for you!
B
87
S
22
G
16
Posts: 715
Reputation: 16,785

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
46
S
14
G
7
Posts: 603
Reputation: 8,106

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


Return to How do I....?

Who is online

Users browsing this forum: eochranek and 21 guests