- Home /
transform.forward wobbles about instead of rolling
transform.Rotate(transform.forward, currentRollVelocity * Time.deltaTime);
Rotating an object around transform.forward or transform.right works fine, but if you rotate slightly around transform.right, then around transform.forward, the object starts spinning in what seems to be a completely random wobble. Same applies to first rotating around forward, then right. transform.forward is pointing in the correct direction, as indicated by the move/rotate tool arrows.
I also tried rotation * Quaternion.AngleAxis(degrees, aroundAxis);
, same results.
Anyone know what's happening?
Answer by Scrawny · Nov 15, 2019 at 10:58 AM
I never figured this out, but for what it's worth, I did found a workaround. I completely ditched using the current rotation of the object and just kept track of the pitch, yaw and roll of the object in separate variables, modified them as needed, then combined those into a new rotation each update