Lumberyard
Getting Started Guide (Version 1.21)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Defining the Door as the Target

The Lua scripts that you added in the previous section don't yet have a target to act upon. You need to specify the door as the target of the script's actions.

To define the door as the Lua script target

  1. In the Entity Outliner,select EntryDoor_Trigger.

    In the Entity Inspector, in the second Lua Script component—the one with the EventName as OpenEntryDoor—click the picker icon next to the Target box.

  2. In the Entity Outliner, select gsg_maze_door. This fills the Target in the Lua Script component with the entity that you selected (gsg_maze_door).

  3. Repeat the previous step for the third Lua script—the one with the EventName as CloseEntryDoor.

    Your two Lua Script components now look like the following image.

  4. Press Ctrl+S to save your level.

  5. Press Ctrl+G to play your level.

    Test your trigger area and triggers by approaching the door. The door should open when you enter the trigger area and close when you leave it.

    You may need to fine-tune the positions to ensure that the door is opening to the position you want.

    Press Esc to quit.

Next: Adding Door Sounds