Rotary angle/mouse issue

Get help using Construct 2

Post » Fri Jan 20, 2012 4:09 pm

Hey!

I have a little problem with my project.

The basic idea is that the player will move towards the mouse position at all times, and at an increased speed when clicked. The problem is that i want a rotary layout, but when i add it, the player seem to follow the mouse in an incorrect way.

Its very hard to explain the issue, as i cant grasp the issue. Below is a capx, try it out and you will see the issue for your self!

.CAPX

Any help is greatly appreciated!
B
34
S
11
G
9
Posts: 189
Reputation: 8,595

Post » Fri Jan 20, 2012 5:47 pm

This looks like a problem for YANN to solve. He is the master of SIN and COS
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Fri Jan 20, 2012 7:37 pm

change
set angle toward(mouse.x,mouse.y)"
to
set angle toward(mouse.x("layer 0"),mouse.y("layer 0"))

Adding the ("layername") only works with the mouse though, so you can't have object.x("layername") unfortunately.keepee2012-01-20 19:38:38
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Fri Jan 20, 2012 7:41 pm

also if you change the name of the layer, it doesn't update it in the expression.. so remember to rename it wherever you referenced it too.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sun Jan 22, 2012 6:01 pm

Thanks alot, it worked :)
B
34
S
11
G
9
Posts: 189
Reputation: 8,595


Return to How do I....?

Who is online

Users browsing this forum: Mohicano and 26 guests