|
|
@ -22,13 +22,13 @@ public class PlayerController : MonoBehaviour |
|
|
|
public void UpdatePosition() |
|
|
|
{ |
|
|
|
float HorseX, HorseZ; |
|
|
|
HorseZ = Input.GetAxisRaw("Vertical"); |
|
|
|
HorseX = Input.GetAxisRaw("Horizontal"); |
|
|
|
HorseZ = receivedInput.y; |
|
|
|
HorseX = receivedInput.x; |
|
|
|
|
|
|
|
float rotateTo = RotateObject(HorseX, HorseZ); |
|
|
|
|
|
|
|
HorseZ = Input.GetAxis("Vertical") * Time.deltaTime * walkSpeed; |
|
|
|
HorseX = Input.GetAxis("Horizontal") * Time.deltaTime * walkSpeed; |
|
|
|
HorseZ *= Time.deltaTime * walkSpeed; |
|
|
|
HorseX *= Time.deltaTime * walkSpeed; |
|
|
|
|
|
|
|
|
|
|
|
transform.Translate(HorseX, 0, HorseZ); |
|
|
@ -71,7 +71,6 @@ public class PlayerController : MonoBehaviour |
|
|
|
} |
|
|
|
yield return new WaitForSeconds(0.5f); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
void Update() |
|
|
|