Skip to main content
deleted 2 characters in body
Source Link
Tak
  • 143
  • 2
  • 11

I'm using Quaternion.Lerp to rotate a joint with a certain angle, but when I use the below code I find the joint rotating very far although I specified it to rotate with only 5. Any thoughts please?

TransformVector3 newRot.y += currentTransform.localRotation.y + 5f;
blendWeight = 0;
if ( blendWeight < 1)
{
    animationRotation = currentTransform.transform.localRotation;
    newRotation = Quaternion.Euler(newRot.x, newRot.y, newRot.z);
    blendWeight += Time.deltaTime/0.9f;
    currentTransform.transform.localRotation = Quaternion.Lerp (animationRotation,newRotation, blendWeight);
}

I'm using Quaternion.Lerp to rotate a joint with a certain angle, but when I use the below code I find the joint rotating very far although I specified it to rotate with only 5. Any thoughts please?

Transform newRot.y += currentTransform.localRotation.y + 5f;
blendWeight = 0;
if ( blendWeight < 1)
{
    animationRotation = currentTransform.transform.localRotation;
    newRotation = Quaternion.Euler(newRot.x, newRot.y, newRot.z);
    blendWeight += Time.deltaTime/0.9f;
    currentTransform.transform.localRotation = Quaternion.Lerp (animationRotation,newRotation, blendWeight);
}

I'm using Quaternion.Lerp to rotate a joint with a certain angle, but when I use the below code I find the joint rotating very far although I specified it to rotate with only 5. Any thoughts please?

Vector3 newRot.y += currentTransform.localRotation.y + 5f;
blendWeight = 0;
if ( blendWeight < 1)
{
    animationRotation = currentTransform.transform.localRotation;
    newRotation = Quaternion.Euler(newRot.x, newRot.y, newRot.z);
    blendWeight += Time.deltaTime/0.9f;
    currentTransform.transform.localRotation = Quaternion.Lerp (animationRotation,newRotation, blendWeight);
}
Source Link
Tak
  • 143
  • 2
  • 11

Quaternion.Lerp not working properly in Unity3d

I'm using Quaternion.Lerp to rotate a joint with a certain angle, but when I use the below code I find the joint rotating very far although I specified it to rotate with only 5. Any thoughts please?

Transform newRot.y += currentTransform.localRotation.y + 5f;
blendWeight = 0;
if ( blendWeight < 1)
{
    animationRotation = currentTransform.transform.localRotation;
    newRotation = Quaternion.Euler(newRot.x, newRot.y, newRot.z);
    blendWeight += Time.deltaTime/0.9f;
    currentTransform.transform.localRotation = Quaternion.Lerp (animationRotation,newRotation, blendWeight);
}