Spawn Vehicle Path Actor¶
The Spawn Vehicle Path actor can be used to generate a path and spawn a single vehicle running along this path by easily doing drag-and-drop, configurating parameters and tweaking the curves.
The Spawn Vehicle Path tool works by using the position of the Spawn Vehicle Path actor and the pre-made spline component attached to the actor to determine the path of the vehicle, which will run along the determined path. At runtime, a list of Waypoints will be generated along the path/curve defined by the spline. They will be separated by the fixed distance (unit in meter) specified by
Using Spawn Vehicle Path¶
You can use one or more Spawn Vehicle Path instances within a scene. To add an instance, drag-drop the Spawn Vehicle Path class from the Content Browser or the AWS Ambit category tab in the Place Actors panel into your map. You'll find the class under "Ambit C++ Classes/Ambit/Actors/Spawners".
After adding an Spawn Vehicle Path to your map you will see an icon like this. You should place it at a 3D location where it's on or above the surface/ground you'd like the vehicle to spawn.
The position of the Spawn Vehicle Path instance is the default starting point of the spline path. You can transform the Spawn Vehicle Path instance by rotation, translation, and scaling to adjust the orientation, position, and length of the spline. You can also add more spline points or manipulate each spline point directly in the viewport or through the Selected Points category of the Details panel.
In fact, a better way to construct and view the whole path is to switch to the Orthographic view of camera and manipulate the spline points there.
Within the Spline component panel, you can also toggle the Closed Loop check box to make the spline a closed loop which will connect the last spline point to the first spline point automatically. The spawned vehicle will then run infinitely along the loop instead of stopping at the end in a normal open spline.
Vehicle to spawn set has to be of class or a derived class of AWheeledVehicle.
Example vehicle blueprint assets can be found in Unreal Marketplace like this or you can follow Unreal tutorial here to create your own vehicle asset.
Examples¶
If you set everything up, you should see the spawned vehicle running along the path with optional display of waypoints.