Z
Z
Zimaell2021-01-04 12:25:47
Unity
Zimaell, 2021-01-04 12:25:47

How to set parabolic movement?

There is an object, when clicked on, it should "fly away", that is, fly up a little and to the side, and then, under the influence of gravity, fly down, the trajectory is similar to a parabola.
And so what we have - there is point A where the object is standing, there is point B where it should eventually land, the question is - how is it easier to do this?

this.transform.position = Vector3.MoveTowards(this.transform.position, new Vector3(EndX, EndY, 0), 5f * Time.deltaTime);

is it just going straight to the point, what should the parabola movement look like or how did I describe it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GFX Data, 2021-01-04
@Zimaell

Attach a RigidBody and fire it into the sky with AddForce(0, 0.5f, thrust, ForceMode.Impulse);. It will fly by itself in a parabola.

F
freeExec, 2021-01-04
@freeExec

This is physics grade 6 - "Movement of an object at an angle to the horizon." With the appropriate formulas and tasks, like with what force and at what angle you need to throw a stone so that it hits the target.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question