Left side movement is how it moves. I need the character to move like the one on the Right side.
It might be basic but I’m pretty new to coding. Thank you.
Basic movement script used:
public Rigidbody rigidbody;
private CharacterController controller;
public float forwardSpeed = 5;
public float maxSpeed = 10;
private float horizontalInput;
public float horizontalSpeed = 10;
void Start()
{
controller = GetComponent<CharacterController>();
}
void Update()
{
horizontalInput = Input.GetAxisRaw("Horizontal");
}
void FixedUpdate()
{
Vector3 forwardMove = transform.forward * forwardSpeed *
Time.deltaTime;
Vector3 horizontalMove = transform.right * horizontalInput * Time.deltaTime *
horizontalSpeed;
rigidbody.MovePosition(rigidbody.position + forwardMove + horizontalMove);
}
