# How to apply rotation to rigid-body transform

Hi,

I have been working on Roll a ball type game. Where i want to rotate the rigid-body on X-axis and rigid-body transform on Y-axis. I know rigidbody rotation and transform rotation are not good friends. After applying rotation it gives jitter effect.

``````void FixedUpdate()
{
if (applyBrakes) { rb.velocity = rb.velocity * 0.85f; return; }
var localInput = moveHorizontal * cvCam.right +   moveVertical * cvCam.forward;
var templocal = transform.InverseTransformDirection(localInput).normalized;
m_TurnAmount =  Mathf.Atan2( templocal.x , templocal.z );
localInput.y = 0;
rb.angularVelocity += new Vector3(localInput.z , 0 , -localInput.x) * force * Time.fixedDeltaTime;
print(m_TurnAmount * Time.fixedDeltaTime * 360);
transform.Rotate(Vector3.up ,  m_TurnAmount * Time.fixedDeltaTime * 360 , Space.World );
if (rb.velocity.magnitude > maxVelocity)
{
rb.velocity = rb.velocity.normalized * maxVelocity;
}
}
``````

Have you adjusted the Maximum Angular Velocity (rb.maxAngularVelocity)?

By default, it caps at 7 radians per second, but if you expect to travel at any appreciable speed, you may want to increase it, starting with something more like 150 (if left capped at all).

Because you’re manually attempting to increase its Angular Velocity each frame, once the next FixedUpdate() pass runs, it will have been slowed back down, potentially resulting in the “jitter” you’re seeing.

Already adjusted the Maximum angular velocity limit to 100. I think main issue exists in rotate function because we are setting the space to “world coordinates” and we are assigning the local coordinates values. When we stop applying the angular velocity the rotation works smoothly no jitter at all.