Hi,
I move my objects in my game based on swipe and after calculations, I have a single vector3 that I pass to rigidbody.addForce in order to move my object.
Thing is, sometimes the player input is slow and thus I multiply the vector3 by a number but this multiplication will make the fast swipes, very fast which is not wanted.
How can I do something like clamp for vector3 so my multiplication would affect the vector by a ceiling and would not go over it.
I was thinking in lines of calculating length of the vector3 but could not get my head around it.
Thanks.
↧