# Angle Equations

Get help using Construct 2

### » Sat Aug 03, 2013 5:15 am

I'm wondering if anyone knows an equation that can basically make this happen:

I have 2 objects (one behind a sprite, and the other in front) with 2 different origin points. I want to be able to rotate the right one to the mouse.x/mouse.y position at all times, while keeping the end of the left object always under but not sticking through the right object (see FIG 3).

The origin points can NOT change due to tons of other code utilizing this method. I'm wondering if I can set the left object's angle using an equation based on the right arm's angle that will change when rotating a 180 arc (from 270 to 90)

Any help would be greatly appreciated!ome6a17172013-08-03 05:17:45
B
51
S
13
G
1
Posts: 577
Reputation: 4,608

### » Sat Aug 03, 2013 7:52 am

can you modify the images to show a representation of the main sprite these 2 are following? I'm having a hard time visualizing exactly what you are trying to do.
B
5
S
1
Posts: 26
Reputation: 427

### » Sat Aug 03, 2013 2:10 pm

Are you required to have any minimum angle between both objects?
B
29
S
10
G
10
Posts: 97
Reputation: 6,614

### » Sat Aug 03, 2013 2:59 pm

Are you OK with one of the arms changing length? Because that will have to happen.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,739

### » Sat Aug 03, 2013 11:04 pm

[QUOTE=sqiddster] Are you OK with one of the arms changing length? Because that will have to happen.[/QUOTE]

I think you're right, Sqiddster. I'm going to try extending the left sprite's length and setting the angle to an image point on the right sprite.

Thanks for the help!
B
51
S
13
G
1
Posts: 577
Reputation: 4,608