dotween icon indicating copy to clipboard operation
dotween copied to clipboard

The pivot of root object changing if i move him using DoMove()

Open AliceMonGithub opened this issue 2 years ago • 2 comments

Hi! I try move the root object with block tiles ( creating from factory in root ) and pivot of them changing to end position ( on video you can see what root object anchoring to offset object ). If i use simple transform.position = newPosition everything is working. How to fix it? Video

Code:

        private void ChangePosition(Vector3 newPosition)
        {
            //_transform.position = newPosition;
            _transform.DOMove(newPosition, _changePositionSmoothTime);
        }

AliceMonGithub avatar Jun 20 '23 15:06 AliceMonGithub

Ahoy! This is very weird, because DOMove simply does a DOTween.To that very straightforwardly sets the transform.position every frame (https://github.com/Demigiant/dotween/blob/develop/_DOTween.Assembly/DOTween/ShortcutExtensions.cs#L476C1-L485) and it certainly doesn't do anything to pivots, so something else must be happening. If nothing comes to mind, could you send me a barebone project that replicates this, so I can check it out?

Demigiant avatar Jun 21 '23 08:06 Demigiant

Ahoy! This is very weird, because DOMove simply does a DOTween.To that very straightforwardly sets the transform.position every frame (https://github.com/Demigiant/dotween/blob/develop/_DOTween.Assembly/DOTween/ShortcutExtensions.cs#L476C1-L485) and it certainly doesn't do anything to pivots, so something else must be happening. If nothing comes to mind, could you send me a barebone project that replicates this, so I can check it out?

It's strange, but in other project everything working. I don't know why, but wrote back if I find problem in main project. Thanks for your answer

AliceMonGithub avatar Jun 21 '23 11:06 AliceMonGithub