- Home /
Tossing an object with the correct force at any distance from another so that it collides with the other
Greetings; I am trying to make it so that you can toss a basketball at any distance from the hoop, but it will always be tossed with the correct amount of force so that it makes it through the hoop. What is the best way to do this? The basketball currently has a sphere collider and a rigidbody, and the hoop has a small sphere collider in its center to check whether or not the ball made it through. Whenever the player picks up the ball, the player turns automatically to face the hoop.
Answer by Alec Thilenius · Dec 19, 2012 at 08:00 PM
Physics, Dr. Watson, Pysics. Use these equations: http://www.physicsclassroom.com/class/1dkin/u1l6a.cfm to calculate the speed needed to launch the ball at to to make the hoop. To simplify things you can just have the player always launch the ball at a 45 deg angle, but it may look unnatural.
If you need help on the physics side, let me know. I just finished a Physics midterm so I don't feel like doing the math right now :P
Actually, if you could walk me through this, that would be great. It's a while since I worked extensively with physics, and while I do understand the kinematic equations, I'm having difficulty applying them in Unity.
Your answer
Follow this Question
Related Questions
Rigidbodies won't collide if mass difference is too high 0 Answers
Character Controller meets Rigidbody 1 Answer
How to get collisions on Character controller? 1 Answer
OnCollisionEnter isnt called when player lands on object 1 Answer
Limiting rigidbody physics influence on another rigidbody 0 Answers