hi, I need to know how to make 2 vector3 not allow to outrange a certain distance.
For example, 1 vector3 is static, the other can move freely, I don’t know how to code the fact that if the distance between both vector are > 10, they can’t be more distant. In that case, the second vector3 have to be still moving in a circle around the first vector, in the direction of his first position’s distance >10.
Thanks for any help !
dynamicVec = center + Vector3.ClampMagnitude(dynamicVec - center, 10);
dynamicVec
is your moving Vector3 and center
is your static Vector3.
I didn’t test it. So let me know if it works or not.
Good day.
You have some confusions my friend… The queation makes no sense.
How can 2 vectors can have distance between them? They are not points in the space, they are vectors, directions with magnitude… You mean 2 positions? The question have no sense…
Edit it to make peopke understand what are you asking talk with property, use correct words…