Quantcast
Channel: Questions in topic: "independent"
Viewing all articles
Browse latest Browse all 102

Can't achieve framerate independent movement

$
0
0
Hello, I can't get my movement to be framerate independent. Here's the code I using inside Update: void Update () { if (Input.GetKeyDown(KeyCode.Escape)) Application.Quit(); if (Input.anyKey) { velx ++; } else { velx *= drag; } velx = Mathf.Clamp(velx, -max_velx, max_velx); Vector3 delta = new Vector3(velx * Time.deltaTime, 0, 0); transform.Translate(delta); } When I change the quality of the graphics in the game.. the player speed changes considirably. I can't see where the problem might come from, since I'm scaling the velocity by the time spent on the frame.

Viewing all articles
Browse latest Browse all 102

Trending Articles



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