Ball 'dribbling' physics


I'm putting together a simple football game and I'm trying to figure out how I'd go about 'interacting' with the ball. At the moment, the ball is a rigidbody object and the players are kinematic box colliders as I want to control the ball interaction accurately.

I figured out that I can addForce to the ball when the player kicks, which you can control fairly easily, but I'm struggling to work out how to get the player to 'dribble' the ball realistically. Since the players speed can vary, I need to apply the correct amount of force to the ball on each update so the ball remains at the players feet but at the same time moves forward at the correct velocity.

Can anyone suggest how I might go about achieving this? I don't want to add the ball object to the players transform, as I want to keep the physics in play at all times.


Cool a football game made in Unity! I'm totally looking forward to see this! I'd try to use addForce for dribblings as well. You just have to calculate the force according to the players velocity. But this would probably only work for "running with the ball", which basically is just kicking and running after it. To get "real" dribbling into the game you'd probably have to do a combination of animation and physics.

im also planing to create football game . but the thing that i need to know how the players going to interact with the ball . because the player action like shooting and passing im going to animate it alon without a ball in 3d max or any software .so how im going to mix these animation and interact with the ball??