I want todo do a kick or its actually a flick since its a flick with the finger on IOS. It sounds easy "Just add some force" but I dont want the physics to go wild and everything to bounce everywhere. So basically I should add force and remove it again after some time, what about objects it hits?
The nice thing about force is that it is applied instantly. All you need is a function that's only called once. In this example, a forward force is applied to the target rigidbody when the user taps the screen. I'm not familiar enough with touch input to get a flick, though. Code (csharp): var kickStrength = 500.0; function Update(){ for (var i = 0; i < Input.touchCount; ++i) { if (Input.GetTouch(i).phase == TouchPhase.Began) { Kick(); } } } function Kick(){ rigidbody.AddRelativeForce (Vector3.forward * kickStrength)); }