i have made this script but i am getting an error that i dont understand
Assets/scripts/movement.js(5,21): BCE0018: The name ‘Vector3.zero’ does not denote a valid type (‘not found’).
the error changes if i move the character motor script around
here is the script thats getting the error:
#pragma strict
var MoveSpeed : float = 50;
var JumpSpeed : float = 55;
var MoveDirection : Vector3.zero;
var Gravity : float = 45;
var JumpActive : boolean = false;
function Start () {
if( JumpActive ){
MoveDirection = new Vector3(Input.GetAxis("Horizontal"), 0 , Input.GetAxis("vertical"));
MoveDirection = transform.TransformDirection(MoveDirection);
MoveDirection *= MoveSpeed;
}
}
if( JumpActive ){
if( Input.GetKey(KeyCode.Space)){
MoveDirection.Y = JumpSpeed;
}
MoveDirection.Y -= Gravity * Time.deltaTime;
var Controller = GetComponent(CharacterController);
var Flags = Controller.Move( MoveDirection * Time.deltaTime);
JumpActive = (Flags & CollisionFlags.CollidedBelow) !=0;
}
function Update () {
}