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

Framerate independent character movement

$
0
0
Hey guys and gals! For a networking project I need a framerate independent movement script (for obvious reasons). I saw this one on UnityCookie but it only moves on the global axis not the local axis. What do I need to change to make it move locally instead of globally? var speed : int = 5; var gravity = 5; private var cc:CharacterController; function Start (){ cc = GetComponent(CharacterController); } function Update (){ if(networkView.isMine){ cc.Move(Vector3(Input.GetAxis("Horizontal") * speed * Time.deltaTime, - gravity * Time.deltaTime, Input.GetAxis("Vertical") * speed * Time.deltaTime)); } else { enabled = false; } } Thanks in advance!

Viewing all articles
Browse latest Browse all 102

Trending Articles



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