aboutsummaryrefslogtreecommitdiffstats
path: root/Assets/Scripts/Projectile.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Projectile.cs')
-rw-r--r--Assets/Scripts/Projectile.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Assets/Scripts/Projectile.cs b/Assets/Scripts/Projectile.cs
index 7692917..b07958b 100644
--- a/Assets/Scripts/Projectile.cs
+++ b/Assets/Scripts/Projectile.cs
@@ -9,11 +9,16 @@ public class Projectile : MonoBehaviour
public Rigidbody2D rb;
// Start is called before the first frame update
- void Start()
+ private void Start()
{
rb.velocity = transform.right * speed;
}
+ private void Update()
+ {
+ Destroy(gameObject, 4f);
+ }
+
private void OnCollisionEnter2D(Collision2D collision)
{
Destroy(gameObject);