aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Assets/Scripts/Controllers/Hoop.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Controllers/Hoop.cs')
-rw-r--r--Assets/Scripts/Controllers/Hoop.cs3
1 files changed, 2 insertions, 1 deletions
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<Ball>() == 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<Rigidbody2D>().velocity.y < 0))
{
HoopAnimator.Rebind();
shotSound.Play();