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

Framerate independent Movement

$
0
0
In my project I have Unity's [CharacterController](http://docs.unity3d.com/Manual/class-CharacterController.html). This is the code that made it move. It's working great when using fixed timestep. vel.x *= friction; vel.z *= friction; vel.x += input.x; vel.z += input.z; cc.Move (vel); I want my game to support unlocked framerate so the character's movement should be updated on per-frame basis. The problem is that the acceleration is really inconsistent. Eventually all framerates hit the maximum speed (they get closer to it every frame), but 1000 FPS reaches it almost instantly, while 15 FPS takes a long time to accelerate. After pondering about it, it makes sense, but I wasn't able to make the acceleration consistent... What is the mathematical solution to this? Any tips are appreciated!

Viewing all articles
Browse latest Browse all 102

Trending Articles



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