|
Hi I have written a script that makes my character move. However, I would like the character to face which ever way the camera is pointing Here is the script: var speed : float = 6.0; var jumpSpeed : float = 8.0; var gravity : float = 20.0; var distance : float = 5; private var moveDirection : Vector3 = Vector3.zero; function Update() { var controller : CharacterController = GetComponent(CharacterController); if (controller.isGrounded) { } I have tried using moveDirection = transform.LookAt(transform.position + Vector3(Camera.forward.x, 0, Camera.forward.z)); to make the character face the direction of the camera but no luck :( Any help would be amazing!
(comments are locked)
|

Is this script on the character or the camera?
"no luck" == compiler error? What is the result of your script?