How to add to a custom level

This page covers how to use the features of the plugin in blueprints. The logic in C++ should be the same.

Copying the demo content to your main content directory:

To prevent changes to your content from being overwritten by updates, let's first move the content from the plugin to your project content directory. The Epic Games Launcher will overwrite files if an update or reinstall is used.

  1. Find the plugin content directory outlined in Getting Setup.

  2. Drag the entire content directory including both Demo Content and Necessary Content to your Main Project Content directory, ideally in a folder.

  3. you should see options to copy, move, or advanced copy. I recommend doing copy.

  4. Thats it, now you should have permanant access to the content from the plugin to work from.

How to add spawners and pathpoints to a custom level:

  1. Find the BP_TrafficPath actor and place it in your level on the road side you want.

  2. Assign it a Right or Left Side enumerator from its details panel in the level editor.

  3. Now populate your roads in your map by doing this for each road, you can extend a spline by dragging spline points or holding Left Alt + Dragging the transform gizmo.

  4. Thats it, traffic should now spawn and follow pathpoints. Next we will setup intersections.

How to add Intersections to a custom level:

  1. Find the BP_TrafficLight actor and drag it into your level where a intersection would be.

  2. Assign it the correct values in the details panel:

  • Traffic Direction Integer: This works with the Traffic intersection manager(see below) to determine if a light should be green or red by seeing if it equals what the current green stop light index is.

  • Road Side FName: you can leave this blank, it's not necessary to fill out.

  • E Traffic Light Direction: This indicates which way the traffic will turn.

  • E Road Side: Use this enum to assign which side of the road this on, this prevents cars on the wrong side from stopping if they see it.

  1. Place these in the order you would like, in the demo level most intersections consist of 4 ways but you can have different types of intersections based on the values you set.

How to add the stop light manager to your level:

  1. Find the BP_StopLightManager in the necessary content folder.

  2. Add this to your level, only add one per level. if using world partition set it to be non spatially loaded.

  3. if you want more than 4 way intersections or to limit it to smaller amounts, open up the actor and change the Greater or equal to value to something other than 4, this represents the max value of stop lights in your level.

  1. That is it, you should now have working traffic in your level. I will be going over car randomization and the AC_NPCTrafficSettingsComponent in the next section.

Need further support? Join the discord

We have a Discord that is open to everyone for support, You can join it here: https://discord.gg/GXZ7c74sTm

Last updated