Forum rules - please read before posting.

Instantiate path,camera,cut

Hi, I´m making a small experiment and need some help.
I had a system that you create a list of chunks, every chunk had some variables associated like Path, Cameras, CutScene. My idea's you start in your car(the car its the player) and you drive trow the path automatically. When you reach the end of the path i want that instantiate the next chunk and get the last point of the path the cut that reference for the start of the path of the next chunk.
I think the camera and cuts don't have any problem because the reference of that it´s inside the prefab chunk, but my question its how can associate the path of the next chunk?


  • See the Paths class's entry in the Scripting Guide here. It's Destination property will tell you the final node position, from where you can place your next Path.

    I'm not totally clear on what you mean by "associate the path" though - are you having trouble placing the next path? Please elaborate further if the above doesn't help.

  • Well a better or think a better explanation. I Made a procedural city with chunks with roads. This roads had paths. What i want its to conect the paths. The problem all its procedural so i dont know the next path until i creat the city.
  • Here some screen for better know
    Here you can see the start and 3 chunks that when you generate a city could be any of them. So i want to connect the base with one of the instantiate chunk.
    Al the chunk has the reference of the path, and camera like this:
    I hope this helps to better know.

  • Do be aware that an AC Paths component is linear - it can't branch off with intersections.

    To connect two Paths together, however, you'd be best off having a separate "final" Path that takes the two separate ones and merges them.

    Paths myFinalPath, pathA, pathB; // Set these in the Inspector or through script
    myFinalPath.nodes.Clear ();
    myFinalPath.transform.position = pathA.transform.position;
    foreach (Vector3 nodeFromA in pathA.nodes)
        myFinalPath.nodes.Add (nodeFromA);
    foreach (Vector3 nodeFromB in pathB.nodes)
        myFinalPath.nodes.Add (nodeFromB);
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.