Im working on a game in which the camera follows the player with the help of Vector3.SmoothDamp(). But when i trigger slow motion the camera is way to slow. I want the camera to feel constantly fast even in slow motion.
Mein Code:
private float slowmotionFactor= 0.2f;
private Vector3 velocityForSmoothDamp;
public void TriggerSlowMotion()
{
Time.timeScale = slowmothionFactor;
Time.fixedDeltaTime = 0.02f * Time.timeScale;
}
private void FixedUpdate()
{
cam.transform.position = Vector3.SmoothDamp(cam.transform.position, player.transform.position, ref velocityForSmoothDamp, 0.01f);
}
↧