- Home /
[HELP] Parabolic movement of a gameObject in Unity
Currently I'm working on a 3D game. In this game my player is a ball and it can jump from tile to tile. The movement of the ball is 45 degrees left or right when it jumps. I want to make it jump in a parabolic path. But I'm unable to do that. I have used Mecanim, AngleAxis, and lerp as well. But the problem is when I use lerp and animation together, firstly the lerp works then the animation(Jump animation). Basically the ball has a parent and mainly the parent lerps between the tiles and the ball itself has the animation clip attached to it.
here is my code attached to the parent :
if (Input.GetKeyDown(KeyCode.LeftArrow))
{
Vector3 dir = Quaternion.AngleAxis(45, Vector3.up) * Vector3.forward;
rb.AddForce(dir * 500);
anim.SetTrigger("LeftSingle");
}
By this I can move the Parent from One tile to another and the Animation works fine with it. But the problem is, the distance it travels is not static.It varies time to time. What will be the best way to fulfill my purpose? Any suggestions or help is appreciated.
Your answer
Follow this Question
Related Questions
What is the best way nowadays to record a film/movie(mp4) with Unity? 1 Answer
Removing instantiated objects?? 1 Answer
How to move 3D character with acceleration and deceleration and face in direction of movement 0 Answers
Door animation bugs and stays open unity 3D 0 Answers
FPS 3D camera view problem 0 Answers