Toss physics actor at specific location

I’m working on a Basketball game and prototyping a shot at the basket. I’m having trouble finding the right combination of nodes to get the ball to be tossed at the hoop. To begin, each shot will be perfect no matter the distance or location. After that is implemented I would add some sort of system to shift the shot’s trajectory to simulate imperfect shots.

Once released from the player, the ball will re-enable it’s physics and let the physics engine take over until the ball is either scored, or repossessed by a new player. The problem I’m having is calculating the correct impulse to apply to the ball in order to get it to land perfectly at my predetermined position.

I’m currently using the SuggestProjectileVelocity Custom Arc node (the ball does not have ProjectileMovement). However, the velocity output doesn’t seem to take into consideration simulated physics. I can multiply the result by some seemingly random value but it still isn’t perfect, and the result is different depending on the distance from the hoop.

Being I’m still learning, I’m not sure if there’s a better way to approach it, or if it’s just a matter putting together a more complex calculus formula to calculate the velocity required, in which I might be more screwed because I don’t know calculus either.

Known values:

  • Ball start position
  • Ball target position
  • Expected angle to land on target position. (should hit the hoop at 45 degree angle).