So Working On This Code and I Don’t Know If I’m Not Thinking Well But I Got This Error In This Code
The name ‘Axis’ does not exist in the current context
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMove : MonoBehaviour
{
private CharacterController charController;
public float movement_Speed = 3f;
public float gravity = 9.8f;
public float rotation_Speed = 0.15f;
public float rotateDegreesPerSecond = 180f;
void Awake ()
{
charController = GetComponent ();
}
// Update is called once per frame
void Update()
{
Move();
Rotate();
}
void Move() {
if(Input.GetAxis(Axis.VERTICAL_AXIS) > 0) {
Vector3 moveDirection = transform.forward;
moveDirection.y -= gravity * Time.deltaTime;
charController.Move(moveDirection * movement_Speed * Time.deltaTime);
} else if(Input.GetAxis(Axis.VERTICAL_AXIS) < 0)
{
Vector3 moveDirection = -transform.forward;
moveDirection.y -= gravity * Time.deltaTime;
charController.Move(moveDirection * movement_Speed * Time.deltaTime);
}
} //move
void Rotate()
{
Vector3 rotation_Direction = Vector3.zero;
if(Input.GetAxis(Axis.HORIZONTAL_AXIS) < 0)
{
rotation_Direction = transform.TransformDirection(Vector3.left);
}
if (Input.GetAxis(Axis.HORIZONTAL_AXIS) > 0)
{
rotation_Direction = transform.TransformDirection(Vector3.right);
}
} // rotate[/code]
Once again Their Might Be a Easy Fix To This