Answer the question
In order to leave comments, you need to log in
How to build a path from point A to point B visually in Unity3D?
Conventionally, there are two objects, let's say two cars. Machine I has a target machine II, it is necessary to visualize the path from machine I to machine II, and not just a ray of the Debug.DrawLine type, but specifically, it was possible to create an object and scale it from object A to object B ... is there any tool? Maybe some video lesson has such content or something else? Help me please.
Answer the question
In order to leave comments, you need to log in
The easiest way is to use the LineRenderer component .
If its capabilities are not enough, then you can instantiate prefabs at each point in the path:
private GameObject waypointPrefab;
private void DrawPath(List<Vector3> path)
{
foreach (var position in path)
{
Instantiate(waypointPrefab, position, Quaternion.identity);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question