How can I make it so when my player hits an object, it moves forward?

To be more specific, I am making a game where you kick a ball. You can dribble it too. Thats what I want at least. So how do I make it so when my player collides with the ball, it moves forward? Also how could I make the player shoot the ball? Thanks.

This will happen automatically if you put colliders and rigidbodies on both objects.

Shooting the ball is slightly more complex, because you have to setup the condition under which the ball can be shot. I’d say that if the ball was within a quarter meter or less then you should be able to shoot the ball. At first just do a rigidbody.AddForce() in a straight line, and play with adding direction and changing the amount of force later.

Or, if you’re doing a passing thing, then fire the ball directly from its current position to the receiving player. If it collides with someone else along the way then it can be intercepted.