Controlling behavior through UMG
In this part of the chapter, we want to touch on using UMG to control the behaviors influenced upon our agents. We will do this by first creating a UMG widget with the proper controls to manipulate our three float variables. Then, we must assign this user widget to the owning PlayerController. Then, we will end by adding a function that will reset the Agents to their original position, starting the simulation fresh.
A simple UI
Let's navigate to our Content Browser, create a new Widget blueprint, and name it FlockingUI
. Let's open this up and go to the Designer tab to get started, as follows:
- Let's drag Vertical Box into our Hierarchy panel.
- Next, set the slot (Canvas Panel) properties: the Size X value to 350.0 and ...
Get Unreal Engine 4 AI Programming Essentials now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.