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
11
S
3
Posts: 278
Reputation: 2,068

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
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

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
90
S
32
G
14
Posts: 935
Reputation: 14,540

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: heliogame and 16 guests