Adding a Pickup Item
Adding a Pickup Item
Now you add an item in the maze that the player must pick up before exiting the maze. The pickup item is a prebuilt slice that you access through the Asset Browser. After you place the pickup item slice, you customize the Lua Script component.
To place a pickup item
- In the Asset Browser, navigate to
StarterGame\Slices\GSG
.
Select maze_pickupobjective.slice
and drag it into your viewport, into the far corner of the maze.
The
maze_pickupobjective.slice
has a number of components and several entities. You modify the properties on one of these components.In the Entity Outliner, select the Maze_PickupObjective slice.
In the Entity Inspector, in the bottommost Lua Script component, under Recipients, next to Entity, click the picker
.
In the Entity Outliner, under ExitDoor_Parent, select Exitdoor_Script.
You now have a pickup that, when retrieved, allows the player to exit the maze.
- Press Ctrl+S to save your level.