integrating itween with physics

I’m essentially trying to use itween to avoid writing (and relearning) a ton of parabolic maths for special kick shots that will move a ball in a certain curve… iTween looks perfect for this, and does save me all the painful maths… however…

The only thing is that I would love to be able to lob, flat kick, trick shot kick my ball off using itween, and have itween move the ball from my origin point to my taret point, then have the physics engine handle the bouncing once it collides with the floor…

Imagine someone kicking a ball from an arbitary x,z and y zero, to a new x and z point, at y zero.
I have a tween that describes this movement.
To get realistic physical bounces, I’m presuming once my tween ends, I need to calculate a force to apply to the ball, and then hand the object over to the physics engine, with that force applied.

Does anyone have any idea how to calculate the force to get the realistic bouncing?

Haven’t tried it, but you might be able to manage something like this:

  • Attach a rigidbody to the ball
  • Before passing control to iTween, make the rigidbody kinematic (ie: script controlled)
  • While iTween is running, find a way to record the ball’s effective velocity (delta position over delta time)
  • When passing control back to physics, assign that velocity and make the rigidbody non-kinematic (ie: physics controlled)