How to apply force to an object?

I am using a gesture API to detect gestures that the user will use to move objects in a 3D space. I just wanted to know how to add force to an object that has a rigid body. Lets say that i do a swipe gesture and I want it to take in the velocity of the swipe, the position of the swipe (start point and end point) and in the end it determines how fast the object moves across a surface.

I am new to the whole gesture recognition and all I want to know is how to get started. Can anyone help me? Many thanks in advanced!

Robertbu and poncho are correct.

The function you need is Rigidbody.AddForce(Vector3 force). It just needs to be strong enough to move your object’s mass.

I’d recommend something like:

    rigidbody.AddForce((endpoint - startpoint).normalized * force);

to experiment. This will ignore the magnitude of your movement and just apply “force” newtons to your object. Make sure force is greater than the object’s mass and see if that works!