- Home /
How to get an Arc movement
Hello. Could someone help me with Vector3.Slerp?
I'm trying to use Slerp to get an arc movement from point A to point B. Like in this image ( https://imgur.com/MZ0zDDO ) but it basically works almost like lerp and it get up a bit on the first movement and then the vertical movement get smaller and smaller every interpolation.
transform.position = Vector3.Slerp (myInitialPos, myNextPos, perc);
Answer by FortisVenaliter · Dec 14, 2017 at 06:43 PM
In this case Slerp would work like Lerp. The y-value is the same in both the start and end positions, so there's nothing to interpolate. If you want it to move in an arc, you've got to at least give the interpolation a middle-point that is raised so it has something to interpolate.
However, I don't think you actually want interpolation. It's definitely not the best solution to get that effect. Think back to basic trigonometry and try to write a function that would give you that curve programatically. Personally, I would start with a Sin wave.
Your answer
Follow this Question
Related Questions
Moving player in an arc, from startPoint to endPoint 2 Answers
How to Lerp or Slerp Time.timeScale change 1 Answer
If a rigidbody is attached, should you always use AddTorque/AddRelative force for rotation/movement? 1 Answer
Lerp and Slerp returns identical value? 1 Answer
Make Quaternion Slerp happen over a 1 second period 3 Answers