Add SlowMo in unity game tutorial | Game Pause logic

Subscribers:
1,110
Published on ● Video Link: https://www.youtube.com/watch?v=MXOoqtOLVcI



Category:
Vlog
Duration: 1:23
32 views
5


Code :
/*
By default Time.timeScale=1.0

When timeScale is 1.0, time passes as fast as real time.

When timeScale is 0.5 time passes 2x slower than
realtime.

When timeScale is 0 your application acts as if paused

*/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SlowMoManager : MonoBehaviour
{
public float valueToSet;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
Time.timeScale = valueToSet;
}
}







Tags:
unity
unity3d
unity2d
learn unity
unity tutorials
slow mo in unity
play pause logic in unity
add slow mo effect in unity
unity Time.timeScale