dotween icon indicating copy to clipboard operation
dotween copied to clipboard

DOShakePosition vibration is inconsistent and sometimes only works in scene window but not in game window

Open SYU15 opened this issue 3 years ago • 2 comments

Hello, I have been working with DOTween PRO for a couple of months and it's been tremendously helpful! However, I ran into a bug yesterday that I think might be related to the one reported in issue #380.

It seems like the magnitude of the vibration might be inconsistent between scene plays in Unity. I believe there should be no randomness based on my code here:

        if (DoShakeTween == null)
        {
            DoShakeTween = transform.DOShakePosition(1.8f, new Vector3(0.018f, 0, 0), 13, 0, false, false)
                .OnComplete(() => AnimationFinished = true)
                .SetEase(Ease.Linear)
                .SetAutoKill(false);
        } else
        {
            DoShakeTween.Restart();
        }

The gif below demonstrates this issue. As you can see, it is shaking only a bit in the scene window and none at all in the game window. This seems to occur maybe 25% of the time. 75% of time, the magnitude of the shake is greater and it works as expected in both windows. I'm on version 1.0.310.

Issue that pops up ~25% of the time: ShakeIssue

Gif where shake is as expected: ShakeNoIssue

SYU15 avatar Aug 16 '21 18:08 SYU15

Looks like a pixel perfect camera prevents the showing of the very small shakes.

ThomasACampbell avatar Mar 27 '24 16:03 ThomasACampbell

I am using a pixel perfect camera so it's very possible it's related (this issue still exists for us).

SYU15 avatar Mar 31 '24 23:03 SYU15