aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Assets/Scripts/Controllers/Ball.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Controllers/Ball.cs')
-rw-r--r--Assets/Scripts/Controllers/Ball.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Assets/Scripts/Controllers/Ball.cs b/Assets/Scripts/Controllers/Ball.cs
index b09b1be..fa9c251 100644
--- a/Assets/Scripts/Controllers/Ball.cs
+++ b/Assets/Scripts/Controllers/Ball.cs
@@ -1,4 +1,5 @@
using System;
+using System.Net.Mime;
using UnityEngine;
namespace Controllers
@@ -18,7 +19,10 @@ namespace Controllers
public void Shoot(Transform playerTransform)
{
- GetComponent<Rigidbody2D>().AddForce((Vector2)(playerTransform.right + playerTransform.up) * shotForce);
+ transform.right = (controller.PlayerHoop.transform.position - transform.position);
+ var rigidbody = GetComponent<Rigidbody2D>();
+ rigidbody.velocity = Vector2.zero;
+ rigidbody.AddForce(transform.right * shotForce);
}
}
}