how to shot a soccer ball in curve path according to the swipe type

How to move the soccer ball in curve path?? Please some one help me… I have to write a logic for swipe type… If I will swipe vertically than the ball should travel straight to the goal. If I will swipe in curve shape for example, in “C” shape then it should travel in “C” path. If swipe in opposite “C” shape than it should travel in opposite “C” path. Please someone help me

If you are using the Physics engine, you will need to add a small force at every frame to simulate the Magnus effect to make the ball curve. If you are simulating physics, then you can use something like a sine curve or a exponential curve to model the movement.

For detecting the “C” you would need capture all the points of movement in the stroke and evaluate them… something like find the max distance of any point from the line connecting the start and end points. The distance from the line could determine the amount of curve, the length of the line could set the initial velocity of the ball, and the which side of the line the max point is found would indicate which way the ball would curve.

Use rigidbodies and its methods (AddForce etc) and all of that will be handled by the physics engine.

Instead of trying to do something complex like gesture-recognition, instead record the position of the touch/mouse at each frame, and work out the distance and direction between it and the previous frame.

So each frame you will get a small change.

Use these to add forces to the ball and make it curve in the same direction.

Check this asset its has both 2d and 3d implementation
link: 2D and 3D Swipe Ball Control | Physics | Unity Asset Store