Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  stutter move
#7
(22-09-2020, 02:12 PM)josemendez Wrote: No need to calculate the torque that would get you to a certain orientation, you could just make the rigidbody kinematic and derive angular velocity from the rotation delta. The formula for that is:

Code:
// get delta rotation (difference between current rotation and previous rotation)
Quaternion delta = transform.rotation * Quaternion.Inverse(prevRotation);

// get angular velocity from that:
unityRigidbody.angularVelocity = new Vector3(delta.x,delta.y,delta.z) * 2.0f / Time.deltaTime;

Thanks! I'm trying to implement your code, do I need to put it in FixedUpdate? because the data changing the rotation is in the update loop.
Reply


Messages In This Thread
stutter move - by julienrobert - 22-09-2020, 03:29 AM
RE: stutter move - by josemendez - 22-09-2020, 07:12 AM
RE: stutter move - by julienrobert - 22-09-2020, 01:01 PM
RE: stutter move - by josemendez - 22-09-2020, 01:06 PM
RE: stutter move - by julienrobert - 22-09-2020, 02:06 PM
RE: stutter move - by josemendez - 22-09-2020, 02:12 PM
RE: stutter move - by julienrobert - 22-09-2020, 02:57 PM
RE: stutter move - by josemendez - 22-09-2020, 03:03 PM
RE: stutter move - by julienrobert - 22-09-2020, 03:11 PM
RE: stutter move - by julienrobert - 23-09-2020, 02:20 PM
RE: stutter move - by josemendez - 23-09-2020, 02:52 PM
RE: stutter move - by julienrobert - 23-09-2020, 03:18 PM
RE: stutter move - by josemendez - 23-09-2020, 03:23 PM