From 25192f07018ad142818a87c2aacac1bf0ecdf551 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Sun, 13 Jun 2021 00:11:07 -0400 Subject: Improve checking of shot --- Assets/Scripts/Controllers/Hoop.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Assets/Scripts') diff --git a/Assets/Scripts/Controllers/Hoop.cs b/Assets/Scripts/Controllers/Hoop.cs index 7e924e7..488c38b 100644 --- a/Assets/Scripts/Controllers/Hoop.cs +++ b/Assets/Scripts/Controllers/Hoop.cs @@ -22,7 +22,8 @@ namespace Controllers { if (other.GetComponent() == null) return; - if (Rim.IsTouching(other) && Net.IsTouching(other)) + // We don't want people shooting up the hoop so check the velocity of the ball to make sure it is going down. + if (Rim.IsTouching(other) && Net.IsTouching(other) && (other.GetComponent().velocity.y < 0)) { HoopAnimator.Rebind(); shotSound.Play(); -- cgit v1.2.3-56-ge451