Character faces direction but then input moves character relative to the position character is facing

This commit is contained in:
Gregory Campbell
2019-10-13 12:56:56 -04:00
parent a38633b581
commit 71667543b7
+3 -1
View File
@@ -31,7 +31,9 @@ public class PlayerController : MonoBehaviour
moveDirection = (transform.forward * Input.GetAxisRaw("Vertical")) + (transform.right * Input.GetAxisRaw("Horizontal"));
//Player rotation
transform.Rotate(0, Input.GetAxis("Horizontal") * Time.deltaTime * rotationSpeed, 0);
//transform.Rotate(0, Input.GetAxis("Horizontal") * Time.deltaTime * rotationSpeed, 0);
Vector3 newPosition = new Vector3(Input.GetAxis("Horizontal"), 0.0f, Input.GetAxis("Vertical"));
transform.LookAt(newPosition + transform.position);
if (extraJump == true)
{