#Game objects have micro-sutters when moving on Time.timeScale 0.5

1 messages · Page 1 of 1 (latest)

fluid kraken
#

Hi, Im trying to make a SlowMotion effect in my 2D Arcade game. Im adding SlowTime powerup and trying to implement it. Current code is this

#
public void SlowTime(Collider2D powerUp){
        StartCoroutine("SlowTimeCoroutine");
        Destroy(powerUp.gameObject);
    }

#
IEnumerator SlowTimeCoroutine(){
        Time.timeScale = Time.timeScale * timeScaleModifier;
        yield return new WaitForSeconds(3f);
        Time.timeScale = baseTimeScale;
    }
#
float baseTimeScale = 1f;
float timeScaleModifier = 0.5f;
#

The problem is, that everything is not looking smooth when moving while slow-mo is active

empty beacon
fluid kraken
#

At this moment everything has set None

empty beacon
#

Side note, use StartCoroutine(SlowTimeCoroutine()) instead of that string version

fluid kraken
#

Should I change it?

empty beacon
fluid kraken
#

Ok, one second

empty beacon
#

As rigidbodies will be updated only during physics steps, not every rendered frame, interpolation will visually smooth the object's position+rotation between those physics steps

fluid kraken
#

Yea, I see

#

Thanks you! Everything working now as it should 🙂