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
21
S
9
Posts: 298
Reputation: 2,967

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
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

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
103
S
38
G
19
Posts: 962
Reputation: 17,996

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: brunopalermo, ItsAstro, kellehk and 29 guests