*

BitBash

Unable to rotate past 90 degrees
« on: August 11, 2015, 08:50:17 PM »
Hi,

DOTween is rocking my world, it's been brilliant so far, however, I have hit an issue.

For some reason when using DOLocalRotate, rotation stops at 90 on the X axis. It happens with all rotation modes. Here is the code I am using to generate the rotation value:

Code: [Select]
if (modifyEnabled == true && modifyRotationEnabled == true)
        {
            calculatedEularRotation = modifyTarget.localEulerAngles;

            if(modifyRotationX == true)
            {
                calculatedEularRotation.x = destination.x;
            }

            if(modifyRotationY == true)
            {
                calculatedEularRotation.y = destination.y;
            }

            if(modifyRotationZ == true)
            {
                calculatedEularRotation.z = destination.z;
            }

            rotationTween = modifyTarget.DOLocalRotate(calculatedEularRotation, modifyRotationSpeed, rotateMode);
        }

Any ideas as to what I am doing wrong.

Thanks!

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Unable to rotate past 90 degrees
« Reply #1 on: August 14, 2015, 01:08:58 PM »
Hi,

Are you sure you're setting the final rotation correctly? I checked, but here everything works correctly. Also, note that you might see the X rotation differently in the Inspector (because it's a conversion from Quaternion to Vector3, so sometimes the correct value is achieved by tweening other axes): what counts is if the object truly rotates visually.

Cheers,
Daniele

*

BitBash

Re: Unable to rotate past 90 degrees
« Reply #2 on: August 15, 2015, 01:19:08 AM »
Hi Daniele,

The actual rotation gets stuck and jitters. I think you are right and that it is nothing to do with DOTween. I'll go and have another look.

Thanks for the reply!