Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

My character fly up very slow.

$
0
0
I modified code, that allows first person controler to fly. Everything is working fine, but... for some reason, my character fly up slower than goes down. My code below. Any idea? var speed = 6.0; function FixedUpdate() { var cam = transform.Find("Main Camera").gameObject.GetComponent(Camera); var moveDirection = cam.main.transform.TransformDirection (Vector3.forward); Debug.Log(moveDirection.x); moveDirection.z =Input.GetAxis("Vertical")*speed; moveDirection.x =Input.GetAxis("Horizontal")*speed; moveDirection.y *=Input.GetAxis("Vertical")*speed; moveDirection = transform.TransformDirection(moveDirection); Debug.Log(moveDirection); var controller : CharacterController = GetComponent(CharacterController); var flags = controller.Move(moveDirection * Time.deltaTime); } @script RequireComponent(CharacterController)

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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