1. Using Juicy Actions Clock
v1.0
We will be using the Juicy Actions Clock for this project. The clock is available at runtime.
Since we are using a pre-made scene, we need to modify existing code. Please be aware that re-importing the Starter Assets - ThirdPerson package risks overwriting the changes we are about to make.
Handling Character Motion
Open ThirdPersonController, and make the following changes:
Add
using MagicPigGames.JuicyActions;to the top of the class.Add a
DeltaTimeproperty:Replace all
Time.deltaTimecalls withDeltaTime.Find the
Move()method, and add to theSmoothDampAnglesignature:, Mathf.Infinity, DeltaTimeβ Here's the full line:
Next, we want to ensure the "Mouse Look" rotation doesn't occur when the game is paused, or the timeScale = 0. Other than that, it's fine to allow full motion at the expected speed.
Find the CameraRotation() method, and add at the top of the method:
Press play: You should see no motion on the player character or the camera.
Handling Animation
Create a new class, AnimatorTimeScaler (see example below). This simple class will set the animator.speed to match the Juicy Actions Clock TimeScale. When the time slows down, animations will slow down. When time stops, so will the animations.
This should be attached to the PlayerArmature, and Spitter. Don't forget to save the prefabs.
Last updated