diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 73b2d7b..e194f0c 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -75,11 +75,11 @@ public class PlayerController : MonoBehaviour moveDirection = (platformForward * curSpeedX * Time.deltaTime) + (transform.right * curSpeedY * Time.deltaTime); - if (isRunning && !runningParticles.isPlaying && Input.GetKey(KeyCode.W)) + if ((currentSpeed + modifier) >= maxSpeed && !runningParticles.isPlaying) { runningParticles.Play(true); } - else if ((!isRunning && runningParticles.isPlaying) || !Input.GetKey(KeyCode.W)) + else if ((currentSpeed + modifier) < maxSpeed && runningParticles.isPlaying) { runningParticles.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear); }