Look, all i want to do is make a car. Every update there seems to be a new problem for me with WheelColliders, this latest one is tricky and i don't understand what is happening. Basically when i try to update my Wheel Transforms (which have the Colliders as components), they flip upside down but now around their own axis, actively flipping the car on its roof and then floats away in a diagonal line upwards and right. What... the... ####?
Also worth noting is that i tried setting localPosition instead but then they fell through the Plane i have the car placed on.
Here is the code:
private void FixedUpdate()
{
UpdateWheel(FLWheelCollider, FLWheelTransform);
UpdateWheel(FRWheelCollider, FRWheelTransform);
UpdateWheel(RLWheelCollider, RLWheelTransform);
UpdateWheel(RRWheelCollider, RRWheelTransform);
}
private void UpdateWheel(WheelCollider col, Transform trans)
{
Vector3 pos;
Quaternion rot;
col.GetWorldPose(out pos, out rot);
trans.position = pos;
trans.rotation = rot;
}
↧