c# – How to limit a character velocity Vector3 to an ellipse in Unity
I was trying to make a Unity character controller where the x and the z speeds are different.
So I needed to make it so the speed of the character can be described as an ellipse.
I can only think of normalizing the velocity vector, finding it’s intersections with the “speed ellipse” (where (x)^2 / a + (y)^2 / b != 1) and multiplying it by magnitude of resulting from intersection vector.
Due to my lack of programming knowledge I don’t really know how to code it 🙁
I think there’s a more elegant and simple solution but i’m just starting to code so i can’t think of one.
Read more here: Source link
