#slow down a rotation
1 messages · Page 1 of 1 (latest)
Lerp
Make the current rotation the start, and the rostation you want it to be to end. Progress I recommend 0.2.
Yes but I want it to go with the speed of the car
Like if it’s going 2 miles turn slower and if it’s going 10 miles go faster
You can try get the velocity of the car, then plug that into a vector get magnitude is what I think it's called. For the lerp. you can just have it where 0 progress is the "reset" position of the wheel, and 1 is where you can turn at full power. You can then divide the velocity's magnitude by however much you want. Just in case, clamp the divided magnitude so it doesnt go over 1 and go past 0.
@digital gate
@bleak forge @digital gate @languid jacinth
This is actually a complicated one that I need to think about, but I think most importantly NEVER EVER use Lerp or Slerp for ANYTHING like this
If you are turning a car, you want the car to turn around the cars up vector, the best way to do this is to multiply the cars rotation by Quaternion Create Angle Axis, where Axis is the cars up vector, and Angle is the angle of the wheels * delta time * [OtherValue]
If you want the car to spin realistically with speed, you need multiply the speed based off the rotation speed of the wheels, although I'm not sure what you are doing with the rotation speed of the wheels, only that you need it, thus why I said "[OtherValue]"
Getting the rotation speed of the wheel is simple
First, get the speed of the car, this should be in meters per second, m/s
Second, get the circumference of the wheel, which is Diameter * Pi
The rotation speed of the wheel in degrees per second is (VehicleSpeed / WheelCircumference) * 360
Again, I know you need to take into account the rotation speed of the wheel, I just dont know how
You could probably simplify the problem into just the speed of the car ignoring all the other steps, but idk 🤷
I finally had time to work on the car again and thanks for the tips I got 2 questions tho
1 how can I slow down the cars rotation when it’s going slower
2 where should I put the invisible collision bc that’s what moving and everything else is clamped to it
or something to fix this
i literally told you how to rotate the car based off the cars speed
The invisible collision would be the cars root part and should be the center of the car
in theory you would like to rotate the car around the rear wheels not the center however
After I multiply the speed by the wheel rotation where do I put it?
If you are turning a car, you want the car to turn around the cars up vector, the best way to do this is to multiply the cars rotation by Quaternion Create Angle Axis, where Axis is the cars up vector, and Angle is the angle of the wheels * delta time * [OtherValue]
You can still do that with Lerp