What is a WaypointCircuit? How I make one?
I'm trying to make a car AI and was checking the unity vehicles standard asset. It has an example of a CarWaypointBasd
that use a WaypointCircuit
. What is this WaypointCircuit
? I found a few videos using it, but I couldn't find what is it or how to make my own to use it.
Answer by Jimirillo · Apr 01, 2016 at 03:21 PM
@Lupus I've just figured this out while looking for the answer to the above question. Create an empty gameobject (your circuit) and attach the 'WayPointCircuit' script from the standard assets. Create a bunch of new empties as your waypoints and attach them to your circuit. then in the waypoint circuit script, hit the 'Assign using all child objects' button to create the circuit. Drag your circuit object onto the AI cars Waypoint progress tracker script.
Hi, it seems that works but i have this messsage on the console "Retrieving array element that was out of bounds" and "UnityEditor.SerializedProperty:InsertArrayElementAtIndex(Int32)"
I have 4 waypoints and de AI car follows them correctly but i have this erros and the thing doesn't finish.
if i put a waypoint in the target field of both or separately "Waipoint progress tracker" and the "Ai car script" the car does not stop.
Any idea? Thanks a lot!
Answer by EnriqueL · Sep 21, 2015 at 11:24 AM
A waypointCircuit is mainly an array of emptygameobjects that you use to move another game object, from point to point, in your case to move the IA car along the track. you can use this tutorial as base Tutorial
$$anonymous$$y problem is how to make a waypoint circuit that can be used with the unity vehicle asset. There is a CarWaypointBased
prefab on it that requires a Waipoint Circuit
object that I don't know how to create to use.