Sprite flipping on path loop
« on: March 17, 2016, 01:28:46 AM »
I have a sprite moving along a closed path in 2D (in the XY plane). As it moves along the path, it flips from one side to the other - always in the exact same places where the path is vertical. I'd like the sprite to stay on the outside of the loop all the way around.

The command I'm using is :

Tweener tween = object.transform.DOPath(waypoints, speed, PathType.CatmullRom, PathMode.Sidescroller2D, 10)
            .SetOptions(true, AxisConstraint.None, AxisConstraint.Z)
            .SetLookAt(0.01f, Vector3.forward, Vector3.up)

I had this working with HoTween. Any suggestions to get this working in DoTween? Is it something about my waypoints or the SetLookAt parameters?

« Last Edit: March 17, 2016, 10:56:47 PM by TweenUser »

Re: Sprite flipping on path loop
« Reply #1 on: March 22, 2016, 02:16:38 AM »
Sorted! Using PathMode.TopDown2D makes it work for me - I assumed working in Unity's 2D mode would be PathMode.sidescroller2D.