WACK-A-MOLE QUEST: ‘Bullet Time’ - Solutions

Quest: Wack-A-Mole Quest
Challenge: Bullet Time

Feel free to share your solutions, ideas and creations below. If you get stuck, you can find some ideas here for completing this challenge.

There’s a Brackeys Bullet Time tutorial on Youtube that helped with this.

thought I’d just drop a link to my changelog for this quest here

I created a new script, with a panel with a canvas group attached to it.

When you kill a mole, the mole trigger the freezer, the time slows and the panel become blue ice.

Then after x seconds, everything return normal.

(I also wrote a Remap function to map values from a generic time interval to 0-1, so i can use Lerp)

1 Like

Very creative! I love it. :grinning:

1 Like

My first attempt seemed simple enough: use a Coroutine that sets Time.timeScale to 0.5f, waits for a half second, and then resets Time.timeScale to 1f. Unfortunately, when timeScale is slowed, Coroutines stop functioning, so timeScale gets stuck at 0.5f.

The other thing I learned while solving this is that if you adjust timeScale, you also need to adjust Time.fixedDeltaTime. (Watch the 10min Brackeys video for the explanation!) Note that all the numbers in the equations below are arbitrary, and can be adjusted to effect.

  1. Create a new script named “BulletTime” with a SlowTime method (which slows the timeScale) and an Update method (which gradually returns timeScale to 1).
public class BulletTime : MonoBehaviour
{
    void Update()
    {
        if (Time.timeScale < 1)
        {
            Time.timeScale += Time.deltaTime;
        }
    }

    public void SlowTime()
    {
        Time.timeScale = 0.1f;
        Time.fixedDeltaTime = Time.timeScale * 0.02f;
    }
}
  1. Attach the BulletTime script as a component to the Timer game object.
  2. Use FindObjectOfType to be able to call the SlowTime method in Exploder.cs’s OnTriggerMethod.