Dotween: DORotateQuaternion not always shortest path

Created on 14 Jan 2016  路  9Comments  路  Source: Demigiant/dotween

DORotateQuaternion does not always animate along the shortest path, in some cases it will go the other way round, the long way.

bug resolved

Most helpful comment

Damn Quaternions! Sorry I skipped this for so long, but here you go :P

P.S. If you're using DOTween Pro DON'T GET THIS! This new version also contains a new From overload that allows to directly set a From value, and the current Pro version doesn't have that implemented yet. If that's your case within the weekend I'll push the Pro on the Asset Store :P

All 9 comments

Yeah I've noticed this issue as well. I believe it's because DORotateQuaternion is easing all of the quaternion components (xyzw), which isn't the correct way to tween a quaternion rotation. It should use Quaternion.Slerp instead.

I've noticed this too. IS this likely to get fixed anytime soon?

Same here, has anyone found a workaround?

I've working on it. Seems that DORotate uses the shortest way

@Demigiant we need this!! =D

I'm too dumb and made a such workaround:

DOVirtual.Float(0, 1, animationDuration, OnRotate);
private void OnRotate(float value)
{
    transform.localRotation = Quaternion.Slerp(sourceRotation, targetRotation, value);
}

Damn Quaternions! Sorry I skipped this for so long, but here you go :P

P.S. If you're using DOTween Pro DON'T GET THIS! This new version also contains a new From overload that allows to directly set a From value, and the current Pro version doesn't have that implemented yet. If that's your case within the weekend I'll push the Pro on the Asset Store :P

Thank you a lot Daniele! ^^
You rock, and do it fast, as always (I know it's your clones hehe)!

I wouldn't say "fast" in this case, I'll have to train my clones better :D

P.S. Dmitriy if you want a DOTween Pro build on the fly obviously you can just ping me via mail or on twitter ^_^

Thanks, Daniele! No hurry here, I prefer to give you more time to better train your clones instead! =D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mukarillo picture Mukarillo  路  4Comments

kruncher picture kruncher  路  7Comments

SharpEdgeMarshall picture SharpEdgeMarshall  路  3Comments

RDeluxe picture RDeluxe  路  8Comments

eduardbosch picture eduardbosch  路  3Comments