ILEGAL
1
In my game the user needs to make a swipe, i calculate that swipe, turn it into a Vector3 (y is 0) and calculate the duration time of the swipe.
In the end of the swipe i apply that Vector3 * durationTime to my rigidbody with ForceMode.Impulse. This swipe is made on Android with touch.
The problem is, when the users makes a swipe too slow but without stopping, the rigidbody instead of going really slow and very low force, it gets a huge force and too fast.
How can I improve this? Having in mind that I have to use the swipe made by the player and his duration time. So that every swipe’s are different, in order to improve gameplay.
Thanks in advance
You can simply use Mathf.Clamp() or make it inversely proportional i.e. divided by durationTime, not multiplied.