A
A
Alexander Andropov2019-05-27 12:02:18
Unity
Alexander Andropov, 2019-05-27 12:02:18

How to move an object (car) along trajectories correctly?

Good day, friends.
I think how to properly organize the movement of an object along the road (cars).
Let's say there is such a zig-zag
q09X_OB5T1xTgcCUNxBpgSeeIy8-BTA13kWHL9MX
How to make the car move along the road.
To move an object via MoveTowards or via velocity and rotate by changing the Quaternions seems to me the wrong decision.
Please tell me how to do it, maybe there is a training video on this topic.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Gaydak, 2019-05-28
@MrMureno

What are your trajectories? just dots? is there a curve between them?
but in general, the approach is quite itself, we move the coordinates and rotate.
I can only say that in many plugins there are also functions to rotate an object to a point ahead along the trajectory
, conditionally, the machine tends to look at the point 2 meters ahead along the trajectory with its nose) it looks more natural sometimes)
If you are not for learning "how to do", but for the project , then perhaps it will be more correct to download Simple Waypoint System from the asset store ($ 15 is not the price for such time savings and a set of examples of how it's all done)

L
Leonid, 2019-05-29
@sled

It is not entirely clear what kind of cars are we talking about, about a bot-car or a controlled player-car?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question