Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Maximum value for a vector3?

$
0
0
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.

Viewing all articles
Browse latest Browse all 171066

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>