]> git.lizzy.rs Git - SuperMouseAdventure.git/blobdiff - 2DGame/Assets/Scripts/Mouse/Stamping.cs
improved movement v0.1
[SuperMouseAdventure.git] / 2DGame / Assets / Scripts / Mouse / Stamping.cs
index 0f1160bf4a9b9ee959be7ab755c4e095ad21c376..76dff765f6fc28aa19dc7a291f658516da13a829 100644 (file)
@@ -12,6 +12,12 @@ public class Stamping : MonoBehaviour
     [SerializeField]
     private float stampingSpeed = 40;
 
+    [SerializeField]
+    GameObject groundCheck;
+
+    [SerializeField]
+    GameObject dustEffect;
+
     private bool isStamping = false;
 
     // Start is called before the first frame update
@@ -32,9 +38,12 @@ public class Stamping : MonoBehaviour
                 rb.velocity = Vector2.down * stampingSpeed;
             }
         }
-        else if (mouseController.isGrounded)
+        else if (mouseController.isGrounded && isStamping)
         {
             isStamping = false;
+            Vector3 spawnPos = new Vector3(groundCheck.transform.position.x, groundCheck.transform.position.y + 1, groundCheck.transform.position.z);
+            Instantiate(dustEffect, spawnPos, Quaternion.identity);
+
         }
     }