Move angle Lerp

Get help using Construct 2

Post » Sat May 11, 2013 3:50 pm

Hi

Is possible move a sprite to new angle using lerp?

I have 1 Global number variable for angle to sprite.

in a event, I setting the new number on variable, and sprite change hers angle, but not use lerp...

thank you very much and sorry for my English

B
19
S
9
Posts: 298
Reputation: 2,910

Post » Sat May 11, 2013 4:00 pm

Set angle to lerp(self.Angle, x, dt) where x is a positive number from 0 - 360 or use anglelerp(a, b, x).

It depends what you want.
ImageImageImageImage
B
146
S
58
G
38
Posts: 2,557
Reputation: 32,504

Post » Sat May 11, 2013 4:02 pm

Use anglelerp(a, b, x) instead for angles.

Edit - got ninja'dC-72013-05-11 16:03:00
B
96
S
34
G
14
Posts: 938
Reputation: 14,896

Post » Sat May 11, 2013 4:21 pm

there's literally an expression called 'anglelerp' that works exactly like lerp, except it takes into account the sudden jump from 360 to 0 degrees.. so it always does the shortest turning


(or 180 to minus 180, rather)

edit: forgot to refresh tab and got double ninja'd by twenty whole minutes.keepee2013-05-11 16:23:01
B
28
S
8
G
1
Posts: 469
Reputation: 4,683


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests