Quantcast
Channel: Questions in topic: "javascript"
Viewing all articles
Browse latest Browse all 68

camera follows player in constant speed even in slow motion

$
0
0
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); }

Viewing all articles
Browse latest Browse all 68

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>