FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionAdding slow motion effect

more_horiz
I am creating a game and i want to add a effect like a man punches someone by pressing any key and the man dies in slow motion with music behind.Plss can anyone help me with this situation.

descriptionRe: Adding slow motion effect

more_horiz
This will allow time to slow down by 50%. Feel free to adjust the number. Then change the time back to normal with 1.

Time.timeScale = 0.5f;

0 = Stop
1 = Normal
2 = Double the speed

_________________
I am Space! Bring Cookies, and I will bring Joy! Razz

descriptionRe: Adding slow motion effect

more_horiz
Like:

Code:


  function Update () {
      if (Input.GetKeyDown (KeyCode.E)) {
        if (Time.timeScale == 1.0)
            Time.timeScale = 0.4;
        else
            Time.timeScale = 1.0;
       
        Time.fixedDeltaTime = 0.02 * Time.timeScale;
      }
  }

_________________
Game Developer
YouTube Channel: https://www.youtube.com/channel/UCra7PcIl3WqSsIChgIAmWrA
Website: http://masterdevelopers.altervista.org/

Permissions in this forum:
You cannot reply to topics in this forum