O'Reilly logo

Unreal Engine 4 AI Programming Essentials by Jie Feng, Peter L. Newton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

  1. Let's drag Vertical Box into our Hierarchy panel.
  2. Next, set the slot (Canvas Panel) properties: the Size X value to 350.0 and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required