This commit is contained in:
2026-01-25 20:17:49 +01:00
parent a21f76314f
commit 087265d63e
13 changed files with 167 additions and 315 deletions
+8 -3
View File
@@ -30,7 +30,8 @@ public class PlayerMove : MonoBehaviour
public Slider awarenessSlider;
private bool walking = true;
private Quaternion lastRotation;
private void Start()
{
rb = GetComponent<Rigidbody>();
@@ -52,10 +53,12 @@ public class PlayerMove : MonoBehaviour
if (!standUp.ispushing && horizontalInput == 1)
{
player.rotation = Quaternion.Euler(90f, 90f, 0f);
lastRotation = Quaternion.Euler(0f, 90f, 0f);
}
else if (!standUp.ispushing && horizontalInput == -1)
{
player.rotation = Quaternion.Euler(90f, 260f, 0f);
lastRotation = Quaternion.Euler(0f, 260f, 0f);
}
else if (horizontalInput == 1)
{
@@ -73,16 +76,19 @@ public class PlayerMove : MonoBehaviour
{
speed += speedincrease;
}
}
else if (verticalInput != 0 && vertical == true)
{
if (!standUp.ispushing && verticalInput == 1)
{
player.rotation = Quaternion.Euler(90f, 0f, 0f);
lastRotation = Quaternion.Euler(0f, 0f, 0f);
}
else if (!standUp.ispushing && verticalInput == -1)
{
player.rotation = Quaternion.Euler(90f, 180f, 0f);
lastRotation = Quaternion.Euler(0f, 180f, 0f);
}
else if (verticalInput == 1)
{
@@ -107,7 +113,7 @@ public class PlayerMove : MonoBehaviour
StartCoroutine(Slide(slide));
if (!standUp.ispushing)
{
player.rotation = Quaternion.Euler(0f, 0f, 0f);
player.rotation = lastRotation;
}
}
transform.Translate(moveDirection * speed * Time.deltaTime, Space.World);
@@ -141,7 +147,6 @@ public class PlayerMove : MonoBehaviour
IEnumerator MakeSound(float delay)
{
while (true)
{
yield return new WaitForSeconds(delay);