How do I smoothly rotate to analog angle

Get help using Construct 2

Post » Sat Jul 04, 2015 10:10 pm

Hello! I am trying to figure out how to make a car object smoothly rotate to the angle of the analog stick.

This is kind of hard to explain

The car is following the analog stick but when i switch direction is sharply just POPS into that direction instead of slowly rotating to that spot like I want it to

Image

here's my code for the car right now

Image
B
6
Posts: 11
Reputation: 572

Post » Sat Jul 04, 2015 10:52 pm

set object angle anglelerp(currentangle,newangle,speed*dt)


Tinker with the speed.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Sun Jul 05, 2015 2:08 am

The "rotate towards angle" action will rotate the object X degrees per tick towards Y angle. Try setting your car.car.steerspeed to a low non-zero value.
B
8
S
2
Posts: 35
Reputation: 572

Post » Mon Jul 06, 2015 6:00 pm

@Drakkith

Oh wow that works perfectly! I cant believe i didnt think of that

thanks so much!
B
6
Posts: 11
Reputation: 572


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests