using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovementPC : MonoBehaviour
{
public float speed;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float x = Input.GetAxis("Horizontal");
float z = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(x, 0, z);
movement.Normalize();
transform.Translate(movement * speed * Time.deltaTime, Space.World);
if(movement != Vector3.zero){
transform.rotation = Quaternion.LookRotation(movement.normalized);
}
}
}
It's always offset by 90 degrees to the left when I use it on my cube.