Lumberyard Tutorials Lumberyard Tutorials Lumberyard Tutorials Lumberyard Tutorials

Lumberyard Tutorials: Lumberyard Tutorials Copyright © Web Services, Inc. and/or its affiliates. All rights reserved.

Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Lumberyard Tutorials Lumberyard Tutorials

Table of Contents

Amazon Lumberyard Tutorials ...... 1 Written Lumberyard Tutorials ...... 2 ...... 2 ...... 2 Creating a Controllable Entity ...... 2 Prerequisites ...... 2 Creating a Controllable Entity ...... 3 Setup a Smooth Follow Action Camera ...... 28 Move an Entity with PhysX Impulse Forces ...... 32 Video Lumberyard Tutorials ...... 45 Lumberyard Editor ...... 45 Download and Install Lumberyard ...... 45 Install Lumberyard Using GitHub ...... 46 Customize Your Lumberyard Installation with the Lumberyard Setup Assistant ...... 46 Your Lumberyard Installation for Android ...... 47 Create a New Project in Lumberyard ...... 47 Assets ...... 47 Importing an FBX File into Your Scene ...... 48 Importing Characters into Lumberyard from FBX ...... 48 Import Animations as Motions ...... 48 Importing Assets Additional Reading ...... 48 Basics of Motion ...... 49 Series Prerequisites ...... 49 Part 1 - Handling Input and Entity Movement ...... 49 Part 2 - Using Linear Interpolation with the Lerp Node ...... 50 Part 3 - Entity Acceleration and Deceleration in Script Canvas ...... 50 Part 4 - Entity Rotation using the Mouse and Enable Kinematic Actors ...... 50 Part 5 - PhysX Movement by using the Apply Linear Impulse Force Node ...... 51 Component entities ...... 51 Creating Slices to Use in Multiple Levels ...... 51 Save and Push Slice Overrides ...... 52 Modify a Parent in the Slice Hierarchy to Create a New Slice ...... 52 Iterate on Game Objects with Nested Templates and Slices ...... 52 Spawn Dynamic Slices ...... 52 Gems ...... 53 Code and Asset Gems ...... 53 Level creation ...... 54 Import a Height-map and Use the Terrain Editor ...... 54 Apply Terrain Texture Materials and the Infinite Ocean Component ...... 54 Configure a Sky-box ...... 54 Animation ...... 55 Animation Editor ...... 55 Animation Graphs ...... 56 Animating an Aiming System ...... 58 Rendering ...... 59 Use the Time of Day Editor to Light a Scene ...... 60 Advanced Environment Lighting with Light Entities ...... 60 Script Canvas ...... 60 Tour of Script Canvas ...... 60 Explosive Red Barrel ...... 61 Tank Demo ...... 62 Using Trigger Areas and Capturing Player Input ...... 63 PhysX system ...... 65 Series Prerequisites ...... 65

iii Lumberyard Tutorials Lumberyard Tutorials

Use the Terrain, Collider, and Rigid Body Components PhysX Components ...... 65 Create and Apply a Physical Material ...... 66 Use Collision Filtering in PhysX ...... 66 Editor Python Bindings ...... 66 Working with the Python Console ...... 67 Writing an Automation Test Python Script ...... 67 Debug Python Scripts with Wing IDE ...... 67 User Interfaces ...... 67 Build an FPS Target with the UI Editor ...... 68 a Main Menu UI Canvas ...... 68 Create a Registration Screen ...... 68 Use String Compares to Add Cheat Codes and Powerups ...... 68 Script an In-Game Timer ...... 69 Audio and Sound ...... 69 Create a New Wwise LTX Project ...... 69 Work with the Audio Controls Editor ...... 69 Work with Ambient Audio using Audio Triggers ...... 70 Play Sounds on a Motion with Motion Events ...... 70 Play Character Dialogue with Switch Containers ...... 70 Audio States and Switch Groups ...... 70 Platform development ...... 70 Optimize Graphics for Mobile ...... 71 Deploy Tool Overview ...... 71 Deploy to an Android Mobile Device ...... 71 Deploy to the AWS Device Farm ...... 71 Document History ...... 73

iv Lumberyard Tutorials Lumberyard Tutorials

Amazon Lumberyard Tutorials

These Amazon Lumberyard tutorials provide step by step instruction from Lumberyard developers aimed to help you explore and use features that enhance your game building. These tutorials walk you through tasks that include controlling variables in your game, creating behaviors without using code, working with FBX files, leveraging AWS, deploying to mobile, and much more.

• Written Lumberyard Tutorials (p. 2) • Video Lumberyard Tutorials (p. 45)

1 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

Written Lumberyard Tutorials

These Lumberyard tutorials provide steps to help you explore and use features that enhance your game building. These tutorials walk you through tasks that include controlling variables in your game, creating behaviors without using code, working with FBX files, and managing your network bandwidth.

v1.22 Written Tutorials

• Tutorial: Creating a Controllable Entity, with a Camera, and with PhysX Overview (p. 2) See how to setup an entity that can be controlled with keyboard a mouse, with a camera, with and without PhysX. • Simple Asset Bundling and Release Tutorial Learn how to setup a release build that uses Asset Bundling.

v1.15 or older Written Tutorials

• Script Canvas Tutorials Learn how to create game logic and behaviors without writing code. • Profiler Tutorial Learn how to use Profiler to capture, save, and analyze statistics to manage network bandwidth. • Getting Started with Multi-player Tutorials Learn how to create a multi-player test game level. • Getting Started with Cloud Canvas Tutorial Familiarize yourself with Cloud Canvas and how to communicate with AWS from Lumberyard using Cloud Gems. • Importing FBX Files as Actors and Motions Tutorials Learn how to bring in characters and their corresponding animations into Lumberyard • Importing FBX Files as Static Meshes Tutorials Learn how to bring in your own models into Lumberyard • Console Variable Tutorial Learn how to use new or existing console variables to control behaviors in your game. • Using Console Variables to Tune Cascade Shadows See how to disable fog and tune the appearance of shadows in your scene.

Tutorial: Creating a Controllable Entity, with a Camera, and with PhysX Overview

This 3 part tutorial is written tutorial using Lumberyard version 1.22. It accompanies our video tutorial found at Basics of Motion (p. 49) They will show you how to use Script Canvas to control and move your entity along with a camera component, with and without PhysX. Prerequisites

• Set the Sample Project as the default project. For more information on switching projects, see Creating and Switching Game Projects. • For access to the assets used, please enable the Primitive Assets gem. For more information, see Enabling Gems. • For access to the debug draw nodes, please enable the DebugDraw gem.

2 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

• To access diagnostic nodes, including the Print node, you must enable the Script Canvas Diagnostic Library gem and then build your game project.

Topics • Tutorial: Creating a Controllable Entity (p. 3) • Tutorial: Set up a Smooth Follow Action Camera (p. 28) • Tutorial: Use PhysX Impulse Forces to Move an Entity (p. 32)

Tutorial: Creating a Controllable Entity

This tutorial walks you through the steps to create a simple sphere that you can control with keyboard and mouse input.

Example

Topics • Step 1: Create a Level (p. 3) • Step 2: Create an Entity and Add a Mesh Component to make it Visible (p. 4) • Step 3: Add an Input Component and Create an Input Binding to control it (p. 6) • Step 4: Add an Script Canvas Component and Capture User Input (p. 13) • Step 5: Rotate your Entity from Mouse Input (p. 24)

Step 1: Create a Level

Before you create a sphere that you can control with keyboard input, you need to create a level.

3 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

To create a level

1. In Lumberyard Editor, choose File, New. 2. In the New Level dialog box, enter ControllableEntityTutorial and then click OK. 3. In the Generate Terrain Texture dialog box, choose 512x512 and then click OK.

Step 2: Create an Entity and Add a Mesh Component to make it Visible

To create an entity

1. In Lumberyard Editor, let's create a new entity from a sphere that can be found in the Primitives gem.

• Click and drag the _Sphere_1x1.fbx asset from the Asset Browser into the Perspective viewport. This creates an entity with a mesh component, and names it _sphere_1x1.

2. After creating your entity, call it SphereMover. This can be done in a few different ways.

a. Option 1 - Right-click on the entity in the Entity Outliner and select Rename.

4 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

b. Option 2 - Alternately double click on the entity in the Entity Outliner.

c. Option 3 - With the entity selected in the Entity Outliner, type in a new value in the Name property in the Entity Inspector.

5 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

Step 3: Add an Input Component and Create an Input Binding to control it

To be able to move an entity

• Now that the Entity has a mesh and is visible, let's add an Input component. This is what will direct player controls specific to this entity. Here is an image of the complete inputbindings file that we're going to step through for reference:

6 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

a. Click on the Add Component button again in the Entity Inspector with your SphereMover entity selected in the Entity Outliner and select the Input component in the Gameplay group.

7 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

b. In the Input component click the joystick button next to Input to event bindings parameter to open the Asset Editor and create an Input Binding. Alternatively you can open it from the Tools menu.

c. Navigate to the Asset Editor panel and click the + button to add a new child element to the Input Event Group.

d. Expand the Unspecified Event and enter MoveForwardBack in the Event Name field. This will update the Unspecified Event name.

8 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

e. Next to the Event Generators parameter click on the + button to add a new element. This is where we can set what keys will be captured.

f. In the Class to create window select the Input class from the drop-down list and click OK.

g. Expand the newly created event and select keyboard from the Input Device Type drop-down list.

9 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

h. Click on the drop-down list next to Input Name and select the keyboard_key_alphanumeric_W to handle moving your sphere forward.

i. Repeat steps 5-8 above to add another event and select keyboard_key_alphanumeric_S to handle moving your sphere backward.

10 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

j. Underneath the event for the S key, change the value of the Event value multiplier to -1.0 which will allow us to take this negative value and move the entity in the opposite direction from our forward input along a single axis for a single event.

k. Repeat steps 3 and 4 above to add a new Input Event and call it MouseTurn.

11 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity l. Repeat steps 5 and 6 above to add a new Input Generator and select mouse for the Input Device Type.

m. Click on the drop-down list next to Input Name and select the mouse_delta_x to get the value of the mouse panning from left to right.

n. Change the Event value multiplier to -1.0 to get the non-inverted values for panning the mouse left to right.

o. We're done editing this file, so let's save it by clicking File and Save or Ctrl+S. Name it BasicMovement.inputbindings in the project/inputbindings folder.

p. Add your input binding to your Input Component by clicking on the browse (...) button and selecting the BasicMovement.inputbindings file.

12 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

Step 4: Add an Script Canvas Component and Capture User Input

Finally we need to add script to get the SphereMover moving

• With the SphereMover entity selected we will add a Script Canvas component and set up the logic to move the entity when the user presses S and W on the keyboard and rotate it using the mouse.

a. Click on the Add Component button again in the Entity Inspector with your SphereMover entity selected in the Entity Outliner and select the Script Canvas component under the Scripting group.

13 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

b. In the Script Canvas component select the Open in Script Canvas Editor button. Alternatively you can also open the Script Canvas Editor from the Tools menu bar.

c. The script canvas graph below shows the entire logic to handle translating your SphereMover on the Y-Axis by pressing W and S. We'll walk through each node step by step below.

d. In the Script Canvas editor you have a couple of options for adding nodes.

14 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity i. You can drag out nodes from the Node Palette.

ii. Alternately you can right-click in an empty place in the graph or drag out of a pin to open the Node Menu.

15 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

e. A common starting point used in a graph is the On Entity Activated event. Find this under Entity::Game Entity.

16 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

f. The Create Input Event Notification ID node takes your input binding event action name and gives it a unique ID to differentiate different sources or players who send the same event. Find this under Gameplay::Input::Input Event Notification ID.

i. In the actionName enter MoveForwardBack from your input binding file. ii. Connect the On Entity Activated Out pin to the In pin.

g. The Input Event bus is used to catch input from the Action Name. You have 3 different options that live under Gameplay::Input

• On Pressed • On Held • On Released

i. Drag in the On Pressed input node.

17 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

ii. Right from within the Input node you can add or remove the other input events by using the Add/Remove Events button. Click on this button and add the On Held event. Optionally, remove the On Pressed event, we encourage you to play with it, but don't plan on using it after this.

18 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

iii. With the Input node selected, navigate over to the Node Inspector and click on Display Connection Controls flag. This will reveal additional input and output pins that will allow for more precise logic control.

19 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

iv. Connect Create Notification ID::Out to Input::Connect v. Connect Create Notification ID::inputEventNotificationID to Input::Source

20 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

h. Let's add a Math::Multiply node by dragging out of the On Held Value pin.

In the Multiply node, set the value of the 2nd number to a value that feels right to you. In this example we set it to 0.1.

21 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

i. We want to take this result and add it to the position of our SphereMover. To convert this result into a vector 3 we can use the Create From Values node found in Math::Vector3.

Since we want to move forward and back, let's map the result to the Y value.

Then connect them as shown in the image below.

22 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

j. Let's get the current position of the SphereMover by using the Get World Translation node under Entity::Transform.

Connect the Create From Values::Out pin to the In pin.

For the Source we can leave it as self since we'll be calling this script from the SphereMover itself.

Take the two vectors and add them together using the Math::Add node as in the image below.

k. Now take the sum and update the position of the SphereMover by passing it into Set World Translation under Entity::Transform.

23 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

l. Save the script by using File - Save and name it TransformMovement.scriptcanvas. m. Set this script in the SphereMover's Script Canvas component. n. Save your level, and then test your results in game. You should be able to move your SphereMover forward and backward by pressing W and S.

Step 5: Rotate your Entity from Mouse Input

Now that your SphereMover can move forward and backward, let's make use of the Mouse input we setup in Step 3 above and set up the capability to turn and rotate on the Z-axis. The current limitation of our control scheme is that it only moves forward and back on the Y-axis of the world. For turning to work correctly, we will change it so that it moves wherever it's local forward direction points.

24 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

To setup rotation and turning on your SphereMover

1. Let's open up the TransformMovement.scriptcanvas file we wrote in Step 4. The first change we will make is to swap out the Create From Values node with a Get Forward found under Entity::Transform

Connect the Multiply Out to the In and the Result to the Scale.

Plug the Get Forward::Out to the Get World Translation::In.

Plug the Forward vector into the Add node.

2. Before adding a new sequence to handle rotation, let's organize our graph by grouping our logic and labeling it into a Node Group. Node groups give you a few benefits like group duplication and group collapsing. For additional information, please see Grouping Nodes.

a. Group select your nodes and right-click on a node within the selection. b. Scroll down and select Group then a category of your choice, in our example we choose Input. c. Label your group something descriptive so anyone diving into your script can quickly identify the goal of the logic. We'll label it Forward/Back Translation.

3. The logic for rotation is nearly identical to the logic you set up for translation. Reference the image below and see the only difference is the actionName and we use Get and Set Local Rotation nodes instead of Get and Set World Translation.

25 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

4. Add a new Create Input Event Notification ID node, and set the action name to MouseTurn.

Just like the other node, connect this to the On Entity Activated out pin.

5. Repeat steps 4.8 and 4.9 to drop in a On Held input event, connected to a Multiply node which is connected to a Create From Values node.

The value you multiply the mouse input by will be smaller. We use 0.01 in our example.

Since we're rotating, we'll pass in the product to the Z value.

Just like the other node, connect this to the On Entity Activated out pin.

26 Lumberyard Tutorials Lumberyard Tutorials Creating a Controllable Entity

6. Just as before, we want to take the current local rotation of the SphereMover and add it with the input, then set this to be the new local rotation.

Drag out a Get Local Rotation node.

Add that with the Vector 3 from the Create From Values node.

Then take that result and pass it into a Set Local Rotation node found under Entity::Transform.

7. Optional: Your logic now allows you to turn your SphereMover while moving. To see it working clearly, let's add some debug information.

a. Drag out a Draw Ray Entity To Direction node found under Debug::Debug Draw Request Bus.

Plug this into the the Get Forward node.

In the Color parameter, set the Green value to 255 and the Alpha value to 255.

The Number parameter is the amount of seconds the ray draws on screen. Since this will execute very often while turning the mouse, we can set it to a small value like 0.01

b. In it's current state, the ray may be difficult to notice, so let's scale it up by using the Multiply By Number node found under Math::Vector3.

Plug this in between the Get Forward node and the Draw Ray Entity To Direction node.

Set the Number to a value you find useful. In our example we set it to 50.

8. Optional: Let's add a head onto our SphereMover to have clearer feedback into where it's facing.

a. Right-click on your SphereMover in the Entity Outliner and select Create Child Entity and rename it to Head.

27 Lumberyard Tutorials Lumberyard Tutorials Setup a Smooth Follow Action Camera

b. With the Head entity selected, add a Mesh component to it from the Entity Inspector. c. In the Mesh component click on the browse button next to Mesh asset. Select Box1x1.fbx from the menu. d. Adjust the position and scale of the Head as in the image below. It should be visible on top of the SphereMover entity.

9. Save your script, and level, and run the game to move and turn your SphereMover in the direction it's facing.

Tutorial: Set up a Smooth Follow Action Camera

This tutorial build off the previous tutorial and your keyboard and mouse controlled SphereMover. This walks you through creating a smooth follow camera that is attached to a moving entity.

28 Lumberyard Tutorials Lumberyard Tutorials Setup a Smooth Follow Action Camera

Example

Topics • Step 1: Create a Camera (p. 29) • Step 2: Smooth out your Camera with Linear Interpolation (p. 31)

Step 1: Create a Camera

Open up your previous level with the SphereMover.

To create and attach a camera entity that is hard attached to your SphereMover

1. Create a new Entity and call it CameraRig. 2. Right-click on your CameraRig entity and add a child entity called SphereCamera. 3. With your SphereCamera entity selected, navigate to the Entity Inspector and add a Camera component.

29 Lumberyard Tutorials Lumberyard Tutorials Setup a Smooth Follow Action Camera

4. Align the CameraRig entity to your SphereMover with the Align to Object button.

Note if you're using the New Viewport Interaction model, you can hold Ctrl + Middle Mouse 5. Position the SphereCamera to achieve the view you want.

You can move it around the perspective viewport from the transform widget or you can select Be this camera from the camera component and position the camera using camera movement controls.

In our example we'll go 3rd person.

6. Select the CameraRig entity and add a Script Canvas component. 7. Create a script and save it as HardCameraAttach.scriptcanvas. 8. This simple script consists of a few nodes. What we want is to set the position of the CameraRig to match the position of the SphereMover every frame.

30 Lumberyard Tutorials Lumberyard Tutorials Setup a Smooth Follow Action Camera

A node event that fires every frame is the On Tick node found under Timing::Tick. 9. Next let's add a Get World Translation node. In the Source parameter select the SphereMover entity with the picker. 10. Finally drag out of Translation and drop in a Set World Translation node that points to the CameraRig or "self".

11. With you script saved, set this script in the CameraRig's script canvas component, don't confuse it with the SphereCamera. 12. Save and test in your game to see your camera in all of its glory.

Step 2: Smooth out your Camera with Linear Interpolation

Open up your previous level with the SphereMover.

Use the Lerp node to smooth out the camera follow

1. In the Entity Outliner right-click on your SphereMover entity and Create a Child Entity called LookAt Point.

Translate this entity in front of the entity. 2. Open the HardCameraAttach.scriptcanvas. Update the Source from the SphereMover to the LookAt Point. In our example the camera will look ahead of your SphereMover instead of directly at it. 3. Add another Get World Translation node to the right of that and point it to Self. 4. Now add a Lerp node, which can be found under Math::Vector3 and hook it in so that we Linearly Interpolate the camera position to the LookAt point.

a. Connect the Camera's (self) translation into the Lerp::Start pin b. Connect the LookAt Pt's translation into the Lerp::End pin c. Set the Percentage to 0.01.

31 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

5. Now set this to the new position of the CameraRig or "self".

6. Test the camera and tune accordingly. Congratulations! You now have a smooth follow camera!

Tutorial: Use PhysX Impulse Forces to Move an Entity

This tutorial builds builds off of concepts from the previous Tutorial: Creating a Controllable Entity (p. 3) and Tutorial: Set up a Smooth Follow Action Camera (p. 28). In this final part you will create an entity and attach a camera just as before, yet with some key differences associated with using Physics and impulse forces.

32 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

Example

Prerequisites

• Enable the PhysX gem from the Project Configurator.

Topics • Step 1: Create Entity with Required PhysX Components (p. 33) • Step 2: Write a Script to push your Entity Forward (p. 35) • Step 3: Add Mouse Turn Support (p. 40) • Step 4: Setup Your Camera (p. 41)

Step 1: Create Entity with Required PhysX Components

Create new level. The first step whenever working with PhysX is adding a Terrain collision component, else your dynamic objects will fall through the world.

It may be helpful to refer back to Tutorial: Creating a Controllable Entity (p. 3) for help creating entities, creating input bindings, and adding entity components.

Set up all the necessary PhysX components needed to let the Physics system drive movement.

1. Add a PhysX Terrain component to any entity in your Entity Outliner. We recommend having a DefaultLevelSetup entity and adding it there. The default values pictured below work fine.

33 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

2. Create a new entity and call it PhysXSphereMover. Please refer to this Tutorial: Creating a Controllable Entity (p. 3) for help.

a. Add a Mesh component to your PhysXSphereMover. b. For the Mesh asset parameter, choose a _Sphere_1x1.fbx. 3. Add a PhysX Collider component to your PhysXSphereMover.

Change the Shape parameter to Sphere to match your Sphere.

Adjust the Radius to fit your Sphere. For us we user 0.5

4. Add a PhysX Rigid Body component.The default values are fine for now.

34 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

5. Add an Input component and use the inputbindings file created in Part 1. 6. Add an Script Canvas component. For help refer to Tutorial: Creating a Controllable Entity (p. 3).

Step 2: Write a Script to push your Entity Forward

The logic for moving an Entity using PhysX impulses is nearly identical to manually moving an Entity. There will be slight adjustments to be made. Refer to the image below for a full reference.

Author a script using Apply Linear Impulse instead of Set Translation.

1. Create a new Script Canvas graph and save it as ImpulseMovement.scriptcanvas. 2. Set this script in the Script Canvas component of your PhysXSphereMover and Save.

35 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

3. Go back to your ImpulseMovement.scriptcanvas graph and navigate to the Variable Manager and let's create a new variable. Select EntityID.

4. This EntityID will hold the head of the PhysXSphereMover. This is what we'll use to point our entity forward. Let's call it EntityToAlign. 5. Click on Expose On Component to show this on the entity's Script Canvas component. Save the script.

6. Now let's go back to the ImpulseMovement script and step through the logic to move the PhysXSphereMover entity. We'll start off like before to get an input event when the user holds a button.

a. A good starting point in a graph is the On Entity Activated node. b. Next drop in a Create Input Event Notification ID node and link it to the previous node. c. In the action name parameter enter MoveForwardBack. d. Now drop in an On Held input node, and click on the Display Connection Controls check box in the Node Inspector e. Connect the Create Input Event Notification ID::Out pin to the On Held::Connect pin. f. Connect the Create Input Event Notification ID:: InputEventNotificationID pin to the On Held::Source pin.

7. Now let's scale the input by using a Math::Multiply node. Enter 0.5 as a starting point.

36 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

8. Now let's get a reference to our EntityToAlign variable. This will point to the CameraRig entity. We have a couple of options here.

a. From the Node Palette under Variable you can select a Get node to your variable.

b. From the Variable Manager menu under Variable you can select a Get node to your variable.

37 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

9. Add a Get Forward node and pass in the EntityToAlign.

Connect the Multiply result to the Scale pin in the Get Forward node as pictured.

10. Add a Apply Linear Impulse node found under PhysX::Rigid Body. Connect it to the Get Forward node as pictured.

38 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

11. Optional - To help debug the behavior and visualize that your vectors are pointing in the right direction, you can make use of a Debug::DebugDrawRequestBus::DrawRayEntityToDirection node.

a. Attach a Get Forward node and link the Forward vector into the Vector3 input pin of the DrawRayEntityToDirection node. b. Connect the Get Forward::Out pin to the DrawRayEntityToDirection::In pin. c. For the Color parameter, set the color value to whatever you like. In our example we set Blue to 255. d. Adjust the Alpha value (A) of the Color parameter to be 255 so that it is fully opaque. e. Set the Number parameter to 0.01. This is the amount of time in seconds that the ray will draw. Since this is called every frame, we only need a short time here.

12. Save your script.

39 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

Step 3: Add Mouse Turn Support

The second half will handle rotation, based on the direction that the camerarig is facing. Refer to the image below for a full reference.

Adjust the ImpulseMovement script to turn the PhysXSphereMover when you pan the mouse left and right.

1. Add a 2nd Create Input Event Notification ID node and an On Held node with a copy and paste. Update the action name to MouseTurnand connect it to On Entity Activated. Refer to the image below.

2. Scale the output value with a Multiply node at 0.001. 3. Add a Math::Vector3::Create From Values node and link the result to the Z-axis. 4. Let's grab another reference to our EntityToAlign and link that to a Get Local Rotation node, 5. Let's use an Math::Add node to get the sum result of the local rotation and the vector3 output from the Create From Values node. 6. Add a Set Local Rotation to take the sum result vector and update the Camera reference from the Get EntityToAlign node.

40 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

7. Optional - Add a Debug::DebugDrawRequestBus::DrawRayEntityToDirection node to visualize the vector result is pointing in the expected direction. See Step 3 - 11 above for more information. 8. Compare your script with the image below for accuracy.

Step 4: Setup Your Camera

In this step we'll build a new camera rig. It will have a head that sits on our sphere and the actual camera.

1. Let's build a CameraRigforPhysX entity that will have 2 child entities.

a. Create a new entity in the Entity Inspector and call it CameraRigforPhysX. b. Right-click on the CameraRigforPhysX entity and select Create child entity. Rename it Camera. c. Create a 2nd child entity on the CameraRigforPhysX and rename it to Head. 2. Let's start by aligning the parent entity, the CameraRigforPhysX with the PhysXSphereMover. This will ensure that the head and camera move at the correct offset that we want.

a. With the CameraRigforPhysX entity selected click on the Align to Objectbutton in the menu bar and then click on the PhysXSphereMover.

b. Alternatively if you're using the New Viewport Interaction model, hold Ctrl + Middle Mouse Button on the PhysXSphereMover. c. Verify that the CameraRigforPhysX is at the same location as the PhysXSphereMover

41 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

3. Now add a Script Canvas component to the CameraRigforPhysX entity.

a. With the CameraRigforPhysX entity selected, add a Script Canvas component to it in the Entity Inspector. b. In the Script Canvas component, click on the Open in Script Canvas Editor button, if you don't already have it open. This will save the step of attaching the script later. c. Save this new script as Camera_AttachToEntity.scriptcanvas

4. The Camera_AttachToEntity.scriptcanvas will consist of 4 nodes as pictured below:

a. Let's create an Entity ID variable called Mover. This will hold a reference to the object we want to snap to. Repeat steps 2.3 - 2.5 above and save your script. b. Since we want to update the position of the CameraRigforPhysX entity every frame, let's use the Timing::Tick::On Tick event.

42 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

c. Drag in a Get Mover node and link its In pin to the On Tick::Out pin d. Drop in a Entity::Transform::Get World Translation node. Connect the Get Mover::Out pin to the In pin, and the Get Mover::EntityID pin to the Source pin. e. Finally, drop in a Entity::Transform::Set World Translation node. Connect the Get World Translation::Out pin to the Set World Translation::In pin and the Get World Translation::Translation vector to the Set World Translation::Translation vector. This will update the position of the CameraRigforPhysX entity. The Set World Translation::Source should point to Self. f. Save your script. 5. With your Camera Rig selected in the Entity Outliner navigate to its Script Canvas component and click on the picker for the Mover parameter. Select the PhysXSphereMover. 6. Now in the Entity Outliner select the PhysXSphereMover. Navigate to the Entity Inspector to the Script Canvas component. You should see a EntityToAlign parameter. Click on the picker and select your CameraRigforPhysX. Save your level.

7. Now let's set up the Head child entity:

a. With the Head entity selected, add a Mesh component to it from the Entity Inspector. b. In the Mesh component click on the browse button next to Mesh asset. Select Box1x1.fbx from the menu. c. Adjust the position and scale of the Head as in the image below. It should be visible on top of the PhysXSphereMover entity.

43 Lumberyard Tutorials Lumberyard Tutorials Move an Entity with PhysX Impulse Forces

8. Now let's setup the Camera. Refer to Tutorial: Set up a Smooth Follow Action Camera (p. 28) Step 1 substeps 3 and 4 for the steps below.

a. With the camera entity selected navigate over to the Entity Inspector and add a Camera component. b. Position the camera to your desired view.

9. Save and test. You may find that you'll need to turn the values you scale and multiply by to get the desired movement sensitivity and feel. You may find the setting up variables that are exposed to the component may save you lot of tuning time moving forward.

44 Lumberyard Tutorials Lumberyard Tutorials Lumberyard Editor

Video Lumberyard Tutorials

These Lumberyard video tutorials cover various tools and features of the editor organized into feature categories, and linked below from the Amazon Game Tech YouTube channel, and the Amazon Lumberyard YouTube channel. You can subscribe to those channels to get the latest content as soon as it is published.

Topics • Lumberyard Editor (p. 45) • Assets (p. 47) • Basics of Motion (p. 49) • Component entities (p. 51) • Gems (p. 53) • Level creation (p. 54) • Animation (p. 55) • Rendering (p. 59) • Script Canvas (p. 60) • PhysX system (p. 65) • Editor Python Bindings (p. 66) • User Interfaces (p. 67) • Audio and Sound (p. 69) • Platform development (p. 70)

Lumberyard Editor

Learn how to install and configure Lumberyard to build your own project with these tutorial videos.

Topics • Download and Install Lumberyard (p. 45) • Install Lumberyard Using GitHub (p. 46) • Customize Your Lumberyard Installation with the Lumberyard Setup Assistant (p. 46) • Build Your Lumberyard Installation for Android (p. 47) • Create a New Project in Lumberyard (p. 47)

Download and Install Lumberyard Learning Objectives

This Lumberyard video tutorial shows how to download the installer from our download page, and install Lumberyard on your PC to your preferred destination. After completing an express install from the Setup Assistant, you'll be ready to run the Lumberyard Editor.

45 Lumberyard Tutorials Lumberyard Tutorials Install Lumberyard Using GitHub

Prerequisites

• Verify that your PC meets the System Requirements. • Download the latest installer. For information, see Downloading Lumberyard.

Tutorial Content

Download and Install Lumberyard

For more information, see the following topic:

• Setting up Lumberyard

Install Lumberyard Using GitHub Learning Objectives

This Lumberyard Video Tutorial shows you another way to install Lumberyard by using GitHub. You'll see how to clone the repo from the GitHub page and run the installer from there. With this method, you can submit your own pull requests with any updates you make to the engine for the Lumberyard team to review and merge into the code. Prerequisites

• A Git interface is required to follow along and clone the repo. The tutorial uses Cmder. • Access the GitHub repo from the Amazon Lumberyard page on GitHub.

Tutorial Content

YouTube Video Link: Install Lumberyard via GitHub

For more information, see the following topic:

• Using GitHub to Download Lumberyard

Customize Your Lumberyard Installation with the Lumberyard Setup Assistant Learning Objectives

This setup video tutorial shows you how to launch and configure the Lumberyard Setup Assistant to do a custom install of the engine. This lets you configure and compile your own projects for your platform of choice with all necessary corresponding SDKs. You'll also get an overview of the various Waf specs available in the Waf build system. Tutorial Content

Configuring the Lumberyard Setup Assistant

For more information, see the following topics:

46 Lumberyard Tutorials Lumberyard Tutorials Build Your Lumberyard Installation for Android

• Using Lumberyard Setup Assistant to Set Up Your Development Environment • Running Lumberyard Setup Assistant

Build Your Lumberyard Installation for Android Learning Objectives

This video tutorial shows how to add the missing SDKs to build for Android, after you've installed Lumberyard and configured the Lumberyard Setup Assistant, Then you'll see how to use lmbr_waf configure to confirm that Android is ready to deploy to. This is a key step for building your games on mobile devices running Android. Tutorial Content

Configure the Lumberyard Setup Assistant to Build for Android

For more information, see the following topics:

• Android Support

Create a New Project in Lumberyard Learning Objectives

This Lumberyard Video Tutorial shows how to use the Project Configurator to create and switch between projects. Additionally, you'll use the Waf build system to compile your project. Prerequisites

• Lumberyard is configured to compile your own game from the Lumberyard Setup Assistant. • You have a compiler. The video uses Visual Studio 2017.

Tutorial Content

Create and Compile a New Project on Lumberyard

For more information, see the following topics:

• Creating and Switching Game Projects • Using the Waf build system

Assets

Learn how to import FBX files into Amazon Lumberyard using the Asset Processor. This is a key step to using homemade assets that you created using third party content creation software.

Topics • Importing an FBX File into Your Scene (p. 48) • Importing Characters into Lumberyard from FBX (p. 48)

47 Lumberyard Tutorials Lumberyard Tutorials Importing an FBX File into Your Scene

• Import Animations as Motions (p. 48) • Importing Assets Additional Reading (p. 48)

Importing an FBX File into Your Scene Learning Objectives

This Lumberyard Video Tutorial shows you how to import an FBX file into your scene. This is a key step for anyone wanting to use homemade assets in Lumberyard Editor. Tutorial Content

FBX to Static Mesh Importing Characters into Lumberyard from FBX Learning Objectives

This Amazon Lumberyard tutorial shows you how to import your own characters, also referred to as peds, from FBX into Lumberyard as actors. Tutorial Content

FBX to Actor Import Animations as Motions Learning Objectives

This Lumberyard Video Tutorial walks through how to import FBX files and animations into Lumberyard as a motion. This is the first step when you want your actors to look more alive and natural. Tutorial Content

Importing Animations into Lumberyard as Motions

For more information, see the following topic:

• Importing Assets into Lumberyard

Importing Assets Additional Reading

You can manually import your assets into Lumberyard, or use Lumberyard Editor to import them for you. For more information, see Importing Assets into Lumberyard.

You can customize the FBX Settings Tool to specify how you import assets. For example, you can select modifiers such as skin, comment, and material for your actors. You can also specify soft naming conventions to tell Asset Processor to scan your files for specific prefixes and suffixes, and then apply changes to them. This can simplify your work flow and make it easier to handle numerous assets when you create your game project.

48 Lumberyard Tutorials Lumberyard Tutorials Basics of Motion

For more information, see FBX Soft Naming Conventions.

When authoring assets to import into Lumberyard there are additional properties to consider before you export your asset. For information, see the following Best Practices for Creating and Exporting Meshes.

Basics of Motion

The Basics of Motion series of video tutorials are sequential. You are encouraged to watch them in order. The videos show you how to:

• Work with input bindings. • Use input bindings to move your entity. • Enhance your entity movements with Script Canvas nodes and variables. • Use physics and its kinematic and impulse forces to move your entity.

Series Prerequisites

To perform the tasks described in this 5-part tutorial series, the following gems must be enabled in the Project Configurator:

• Primitive Assets • PhysX • PhysX Debug • Script Canvas • Script Events • Script Canvas Diagnostic Library

For instructions about enabling these gems, see Enabling Gems.

Basics of Motion • Part 1 - Handling Input and Entity Movement (p. 49) • Part 2 - Using Linear Interpolation with the Lerp Node (p. 50) • Part 3 - Entity Acceleration and Deceleration in Script Canvas (p. 50) • Part 4 - Entity Rotation using the Mouse and Enable Kinematic Actors (p. 50) • Part 5 - NVIDIA PhysX Movement by using the Apply Linear Impulse Force Node (p. 51)

Part 1 - Handling Input and Entity Movement Learning Objectives

This Lumberyard Video Tutorial introduces you to input mapping. Learn how to create an input binding on the keyboard. You then learn how to set translation using Script Canvas on an entity to move it around the level. Prerequisites

• You must also enable the gems described in the Series Prerequisites section in this topic.

49 Lumberyard Tutorials Lumberyard Tutorials Part 2 - Using Linear Interpolation with the Lerp Node

Tutorial Content

Handling Input and Entity Movement Part 2 - Using Linear Interpolation with the Lerp Node Learning Objectives

This Lumberyard tutorial shows how to extend the way you move an entity in the previous tutorial by using the Linear Interpolation or LERP node in Script Canvas. You'll learn how by specifying a start position and a destination, the engine will procedurally generate the in-between points to smoothly guide your entity to its destination, creating a smooth sense of movement. Prerequisites

• You must also enable the gems described in the Series Prerequisites section in this topic.

Tutorial Content

Using Linear Interpolation with the Lerp Node Part 3 - Entity Acceleration and Deceleration in Script Canvas Learning Objectives

This Lumberyard Video Tutorial shows how to extend the entity movement by using variables to store the current velocity. It then shows how to add it to the change in position to create a sense of acceleration and deceleration when moving your entity. Prerequisites

• You must also enable the gems described in the Series Prerequisites section in this topic.

Tutorial Content

Entity Acceleration and Deceleration in Script Canvas Part 4 - Entity Rotation using the Mouse and Enable Kinematic Actors Learning Objectives

This Lumberyard Video Tutorial demonstrates how to use set rotation on your entity by setting up an input mapping on your mouse to control the turning. It shows how to adjust the mouse sensitivity during

50 Lumberyard Tutorials Lumberyard Tutorials Part 5 - NVIDIA PhysX Movement by using the Apply Linear Impulse Force Node

turning. It also shows you how to enable the kinematic flag on the PhysX Rigid Body component to let NVIDIA PhysX handle collision interactions between your rigid body entities. Prerequisites

• You must also enable the gems described in the Series Prerequisites section in this topic.

Tutorial Content

Entity Rotation using the Mouse and Enable Rigid Body Kinematic Actors Part 5 - NVIDIA PhysX Movement by using the Apply Linear Impulse Force Node Learning Objectives

This Lumberyard Video Tutorial shows you a different way to move your entity by using the NVIDIA PhysX system. Instead of using set translation, you use the Apply Linear Impulse Node on your PhysX Rigid Body component in Script Canvas. Prerequisites

• You must also enable the gems described in the Series Prerequisites section in this topic.

Tutorial Content

05 - Nvidia PhysX Movement by using the Apply Linear Impulse Force Node

Component entities

A slice is a collection of configured entities that is stored as a single unit in a reusable asset. You can use slices to conveniently group entities and other slices for reuse. For more information, see the Working with Slices in the Amazon Lumberyard User Guide.

Topics • Creating Slices to Use in Multiple Levels (p. 51) • Save and Push Slice Overrides (p. 52) • Modify a Parent in the Slice Hierarchy to Create a New Slice (p. 52) • Iterate on Game Objects with Nested Templates and Slices (p. 52) • Spawn Dynamic Slices (p. 52)

Creating Slices to Use in Multiple Levels Learning Objectives

See an overview of what slices are, and see how to create, instantiate, and modify them. Slices can be made from a single entity or with multiple.

51 Lumberyard Tutorials Lumberyard Tutorials Save and Push Slice Overrides

Tutorial Content

YouTube Video Link: Creating Slices for Use in Multiple Levels Save and Push Slice Overrides Learning Objectives

This Lumberyard Video Tutorialshows how to save a change made to a slice. This action is called a Slice override. Additionally, when you want to apply a change across all instances of that slice, that action is called Push Slice Overrides. For example, you can reuse a slice instance to create multiples entities in your game, such as a tree. If you modify one of the trees (such as its mesh asset), you can then apply the change to all other instances of the slice. This makes it easier to maintain consistency for your entities, especially if you have many slice instances in a level. Tutorial Content

YouTube Video Link: How to Save and Push Slice Overrides Modify a Parent in the Slice Hierarchy to Create a New Slice Learning Objectives

See information about configuring your slices. Learn why the way you configure your slices is important. Also find out what you can modify in the parent slice, and how that affects the child slices in the hierarchy. Tutorial Content

YouTube Video Link: Modify a Parent in the Slice Hierarchy to Create a New Slice Iterate on Game Objects with Nested Templates and Slices Learning Objectives

Use slices in Lumberyard to transform your DCC assets into interactive game objects using the power of slices. Then see how you can spawn dynamic slices at runtime. Tutorial Content

YouTube Video Link: Iterate on Game Objects with Nested Templates and Slices Spawn Dynamic Slices Learning Objectives

See how use slices and dynamic slices in Script Canvas to set up a scene.

52 Lumberyard Tutorials Lumberyard Tutorials Gems

Tutorial Content

YouTube Video Link: Dynamic Slices in Action

Gems

Lumberyard gems are self-contained packages of code and content that can be shared between different games using Lumberyard. For more information, see the Using Gems to Add Modular Features and Assets in the Amazon Lumberyard User Guide.

Topics • Code and Asset Gems (p. 53)

Code and Asset Gems

Lumberyard gems are self-contained packages of code and content that can be shared between different games by using Lumberyard. For more information, see the Using Gems to Add Modular Features and Assets in the Amazon Lumberyard User Guide.

Topics captured in v1.11 • Working with Code Gems in Lumberyard (p. 53) • Create and Enable Asset Gems (p. 53)

Working with Code Gems in Lumberyard Learning Objectives

This walkthrough demonstrates adding functionality to a Lumberyard game project by enabling a gem containing unique content, and then adding content to that gem. The purpose of this demo is to show how you can use gems to expand the content and functionality of your Lumberyard game project. Tutorial Content

YouTube Video Link: Working with Code Gems

For more information, see the following topics:

• Programming with Gems

Create and Enable Asset Gems Learning Objectives

Learn how to create and enable your own code and asset gems to be reused across different projects in Lumberyard. Tutorial Content

YouTube Video Link: Cloud Gems in Action

For more information, see the following topics:

53 Lumberyard Tutorials Lumberyard Tutorials Level creation

• Using Gems to Add Modular Features and Assets

Level creation

For more information, see the Creating Terrain in the Amazon Lumberyard User Guide.

Topics • Import a Height-map and Use the Terrain Editor (p. 54) • Apply Terrain Texture Materials and the Infinite Ocean Component (p. 54) • Configure a Sky-box (p. 54)

Import a Height-map and Use the Terrain Editor Learning Objectives

Importing the height map is the first step is setting up your world terrain. Import height maps directly into your scene and modify them using the Terrain Editor and its various brushes and masks to raise and lower the terrain, as well as flatten and smooth it out. Tutorial Content

YouTube Video Link: How to Import a Height map and use the Terrain Editor

For more information, see Using the Terrain Height map in the Amazon Lumberyard User Guide Apply Terrain Texture Materials and the Infinite Ocean Component Learning Objectives

Use terrain texture materials to create a realistic and detailed environment for your game project. Use the Infinite Ocean component to add an ocean surface around your level. Tutorial Content

YouTube Video Link: Terrain Texture Materials and the Infinite Ocean component

For more information, see Using Terrain Texture Layers and the Infinite Ocean component in the Amazon Lumberyard User Guide Configure a Sky-box Learning Objectives

This Lumberyard Video Tutorial shows you how to:

• Create a tile-able texture. • Import the texture into Lumberyard. • Configure a material in the Material Editor. • Apply the sky box shader.

54 Lumberyard Tutorials Lumberyard Tutorials Animation

• Apply the sky box material to the environment.

Tutorial Content

YouTube Video Link: Setup a Sky box

Animation

These Amazon Lumberyard video tutorials walk through working with the EMotionFX Animation System in Lumberyard on version 1.11 of the engine.

For more information, see the Creating and Animating Characters in the Amazon Lumberyard User Guide.

Topics • Animation Editor (p. 55) • Animation Graphs (p. 56) • Animating an Aiming System (p. 58)

Animation Editor

These Amazon Lumberyard video tutorials walk through using the EMotionFX Animation Editor in Lumberyard. Use the Animation Editor to animate characters in Amazon Lumberyard. Import your character and animations into the Animation Editor, and pair the animations to the character to bring them to life, then preview them.

The following videos cover the 1.11 version of Lumberyard. • Launch EMotionFX Animation Editor (p. 55) • An Overview of the EMotionFX Animation Editor (p. 55) • Import Animations in EMotionFX (p. 56) • Motion Extracting and Mirroring in EMotionFX (p. 56)

Launch EMotionFX Animation Editor Learning Objectives

See how to enable the EMotionFX Animation gem in the Project Configurator, Build your gem with the WAF build system, and then open the Animation Editor from the Tools menu. Tutorial Content

YouTube Video Link: Launch EMotionFX An Overview of the EMotionFX Animation Editor Learning Objectives

Get an overview of the Animation Editor and all of its view ports and windows. Tutorial Content

YouTube Video Link: An Overview of the EMotionFX Animation Editor

55 Lumberyard Tutorials Lumberyard Tutorials Animation Graphs

Import Animations in EMotionFX Learning Objectives

Learn how to import FBX actor and animation files, set up an animation graph, and create a motion set. Also, see how to preview motions in the Animation Editor. Tutorial Content

YouTube Video Link: Importing Animations in EMotionFX Motion Extracting and Mirroring in EMotionFX Learning Objectives

See how to extract a motion and then mirror it. That way you don't have to re-export an animation to get the opposite side working if you captured only one side. For example, you have a motion of a robot bouncing a ball with its right hand. You could then mirror it so that the robot could bounce with its left hand when it turns around, or has something occupying it's right hand. Tutorial Content

YouTube Video Link: Motion Extracting and Mirroring in EMotionFX Animation Graphs

These Amazon Lumberyard video tutorials walk through authoring Animation Graphs in the EMotionFX Animation Editor in Lumberyard. Animation graphs define the animation behavior for your game characters. Animation graphs contain the states that the character can have and define the transitions between these states. Each transition can have a set of conditions that define the logic behind the transitions. Animation graphs contain nodes and the connections between them. These connections define how data is passed between the nodes or how transitions occur between nodes.

For more information, see the Animation Editor Concepts and Terms in the Amazon Lumberyard User Guide.

The following videos cover the 1.11 version of Lumberyard. • Create an Animation Graph (p. 56) • Employ Anim Graph State Transitions (p. 57) • Author Anim Graph Parameters (p. 57) • Understand Transition Conditions (p. 57) • Use the Play Time Animation Transition Condition (p. 57) • Create Hierarchical State Machines, Part 1 (p. 57) • Create Hierarchical State Machines, Part 2 (p. 58) • Compose Blends between Motions, Part 1 (p. 58) • Compose Blends between Motions, Part 2 (p. 58) • Organize Anim Graphs with Node Groups (p. 58)

Create an Animation Graph Learning Objectives

See how to create a new graph in the Animation Editor. You also see how to bind animations and motions to different character states, and create logic for transitioning between states.

56 Lumberyard Tutorials Lumberyard Tutorials Animation Graphs

Tutorial Content

YouTube Video Link: Create an Animation Graph Employ Anim Graph State Transitions

Learning Objectives

Learn how to add a transitions between different animation states to switch to a different animation cycle, depending on specific conditions.

Tutorial Content

YouTube Video Link: Creating Anim Graph State Transitions Author Anim Graph Parameters

Learning Objectives

See how to bind your animation states to parameters created in the Animation Editor. A common use for binding your animation states is a player jump, a player slide, or a dodge manuever.

Tutorial Content

Author Anim Graph Parameters Understand Transition Conditions

Learning Objectives

Learn how to create automatic conditions that queue an animation transition between the idle state and the jump state.

Tutorial Content

YouTube Video Link: Understand Transition Conditions Use the Play Time Animation Transition Condition

Learning Objectives

Listen for play time condition in your animation before activating a transition back to the idle pose.

Tutorial Content

YouTube Video Link: Use the Play Time Animation Transition Condition Create Hierarchical State Machines, Part 1

Learning Objectives

Learn how to separate your animation states by using hierarchical state machine nodes. Also, learn how to work with the entry and exit nodes to optimize your animation states.

57 Lumberyard Tutorials Lumberyard Tutorials Animating an Aiming System

Tutorial Content

YouTube Video Link: Create an Animation Hierarchical State Machine using the State Machine Node Create Hierarchical State Machines, Part 2 Learning Objectives

Continue building the Animation State Machine constructed in Create Hierarchical State Machines, Part 1 by using a parameter condition to add a transition condition between the Idle State and the Jump State. Tutorial Content

YouTube Video Link: Creating Hierarchical State Machines Part 02 Compose Blends between Motions, Part 1 Learning Objectives

Use the blend tree node to transition smoothly between animations. Tutorial Content

YouTube Video Link: Compose Blends between Motions Part 01 Compose Blends between Motions, Part 2 Learning Objectives

Automate transition between your animation states using blend nodes and parameters node. Tutorial Content

YouTube Video Link: Creating Blends between Motions Part 02 Organize Anim Graphs with Node Groups Learning Objectives

Node groups are useful ways to box and group functionality in anim graph with a label. Tutorial Content

YouTube Video Link: Using Node Groups to Organize your Anim Graph Animating an Aiming System

These Amazon Lumberyard video tutorials walk through using the Animation Editor in Lumberyard to author a 3rd person perspective aiming system.

The following videos cover the 1.23 version of Lumberyard. • Animation Editor Aiming System Overview (p. 59) • Using Blendspace and IK Nodes (p. 59) • Add Locomotion to your Character (p. 59)

58 Lumberyard Tutorials Lumberyard Tutorials Rendering

• Anim Node Logic to Stop Aiming when Running (p. 59)

Animation Editor Aiming System Overview Learning Objectives

Learn how to use the Amazon Lumberyard Animation Editor to setup the cowboy's aiming system that is included in the new PhysXSamples gem. Tutorial Content

YouTube Video Link: An Aiming System Overview Using Blendspace and IK Nodes Learning Objectives

Learn how to set up the anim graph and state machine along with BlendSpace nodes to blend between 3 different aiming poses and IK Nodes to get the wrist to aim at the target. Tutorial Content

YouTube Video Link: Using Blendspace and IK Nodes in an Anim Graph Add Locomotion to your Character Learning Objectives

Learn how to get a character walking and running in the Animation Editor. Tutorial Content

YouTube Video Link: Adding Locomotion to Your Character Anim Node Logic to Stop Aiming when Running Learning Objectives

Extend the previous lesson by adding specific actions that will stop the aim system when the character is running. Tutorial Content

YouTube Video Link: Node Logic to Stop Aiming When Running

Rendering

Game Engines have various different lighting models to choose from for rendering. Physically Based Rendering, abbreviated as PBR, is the current industry standard.Lumberyard uses physically-based lighting and shading models to implement global illumination and lighting.

To get more details on the Lumberyard renderer, see Adding Lighting and Shadows in the Amazon Lumberyard User Guide.

59 Lumberyard Tutorials Lumberyard Tutorials Use the Time of Day Editor to Light a Scene

Topics Captured in v1.13 • Use the Time of Day Editor to Light a Scene (p. 60) • Advanced Environment Lighting with Light Entities (p. 60)

Use the Time of Day Editor to Light a Scene Learning Objectives

This Lumberyard Video Tutorial showcases lighting work-flows from the Amazon Lumberyard GDC 2018 Arcadia demo. This tutorial uses the Time of Day Editor, fog, and sun settings to light a scene in real time. Tutorial Content

YouTube Video Link: Light your scene in real time using the Time of Day Editor. Advanced Environment Lighting with Light Entities Learning Objectives

This GDC 2018 classroom demo showcases the key components of the rendering engine in Amazon Lumberyard. It details global illumination, time of day, environment probes, materials, and light entities. Tutorial Content

YouTube Video Link: How To Light Your Level and Environment Lighting

Script Canvas

Script Canvas is a visual scripting environment for Amazon Lumberyard. You can use it to create game logic and behaviors across many components in the engine.

For more information, see Creating Gameplay with Script Canvas in the Amazon Lumberyard User Guide.

Topics • Tour of Script Canvas (p. 60) • Explosive Red Barrel (p. 61) • Tank Demo (p. 62) • Using Trigger Areas and Capturing Player Input (p. 63)

Tour of Script Canvas

These Lumberyard video tutorials serve to familiarize you with the Script Canvas editor. They show you some of the handy tools and panels that are available to you. Then you can step through the more detailed tutorials.

The following videos cover the 1.14 version of Lumberyard. • A Tour of the Script Canvas Editor (p. 61)

60 Lumberyard Tutorials Lumberyard Tutorials Explosive Red Barrel

• Use Bookmarks and Comments in Script Canvas (p. 61)

A Tour of the Script Canvas Editor Learning Objectives

Get an overview of the Script Canvas editor, the Node Palette, the Variable Manager, and the Node Inspector. Then learn how to print to the console. Tutorial Content

YouTube Video Link: A Tour of the Script Canvas Editor Use Bookmarks and Comments in Script Canvas Learning Objectives

Learn how to add bookmarks and comments to organize your logic. These features make it easier for you to label your nodes, add useful comments for your team, and describe how your Script Canvas graph works. Tutorial Content

Learn how to add bookmarks and comments to organize your logic.

For more information, see Adding Bookmarks for Script Canvas and Adding Comments for Script Canvas in the Amazon Lumberyard User Guide.

YouTube Video Link: Add Bookmarks and Comments in Your Script Canvas Graph

For more information, see the following topics:

• Adding Bookmarks for Script Canvas • Adding Comments for Script Canvas

Explosive Red Barrel

These Lumberyard video tutorials are a 4-part series that demonstrate how to use Script Canvas along with NVIDIA PhysX to create an explosive prop that pushes other objects in the scene physically with impulse forces. This series is best viewed sequentially.

The following videos cover the 1.21 version of Lumberyard • Part 1 - Script an Explosive Prop (p. 61) • Part 2 - Add Impulse Force to Explosions (p. 62) • Part 3 - Send a Collision Event to Deal Damage (p. 62) • Part 4 - Attach a Linear Impulse to Move Props (p. 62)

Part 1 - Script an Explosive Prop Learning Objectives

Setup a barrel that interacts with a collision event from the player and will play an explosive particle effect.

61 Lumberyard Tutorials Lumberyard Tutorials Tank Demo

Tutorial Content

YouTube Video Link: Scripting an Explosive Prop Part 2 - Add Impulse Force to Explosions Learning Objectives

Learn how to attach a PhysX impulse force to an entity that is triggered through Script Canvas and will interact with other NVIDIA PhysX rigid body components. Tutorial Content

YouTube Video Link: Adding Impulse Forces to an Explosion Part 3 - Send a Collision Event to Deal Damage Learning Objectives

See how to work with Script Events to send a damage event to the player from a collision event. Tutorial Content

YouTube Video Link: Deal Damage on Collision Events Part 4 - Attach a Linear Impulse to Move Props Learning Objectives

Learn how to take your explosive barrel and apply a linear impulse on player damage to send the barrel into the air. Tutorial Content

YouTube Video Link: Playing with Linear Impulses on Damage Tank Demo

These Lumberyard video tutorials are a 3-part series that demonstrate how to use Script Canvas to control a tank slice, with full movement and shooting controls. This series is best viewed sequentially.

For more information, see Creating Gameplay with Script Canvas in the Amazon Lumberyard User Guide.

The following videos cover the 1.14 version of Lumberyard • Part 1 - Binding Movement Controls (p. 62) • Part 2 - Spawning and Firing Projectiles with Legacy Physics and Dynamic Slices (p. 63) • Part 3 - Attach a Camera and Creating Explosive Dynamic Slices (p. 63)

Part 1 - Binding Movement Controls Learning Objectives

Setup a tank that can be controlled from the keyboard. This Lumberyard Video Tutorial will create a Script Canvas graph that can access the Input component and input bindings within an entity, to move

62 Lumberyard Tutorials Lumberyard Tutorials Using Trigger Areas and Capturing Player Input the tank around your scene. This tutorial also show you how to nest an entity into another entity so that when you control the parent entity, the child entities follow the parent. Tutorial Content

YouTube Video Link: Binding Movement Controls Part 2 - Spawning and Firing Projectiles with Legacy Physics and Dynamic Slices Learning Objectives

This section follows the tank demo in part 1. It walks through using Script Canvas to spawn a dynamic slice and apply physics impulses to give the dynamic slice a projectile behavior. Tutorial Content

YouTube Video Link: Spawning and shooting a Projectile with Legacy Physics and Dynamic Slices Part 3 - Attach a Camera and Creating Explosive Dynamic Slices Learning Objectives

In the conclusion to the tank demo, you'll see how to attach a camera to the tank that follows it as it moves. Then see how to add an explosive barrel to the scene that when shot at uses Script Canvas to destroy it and trigger an explosion particle effect.

To download the pre-configured assets to follow along, see Explosive Barrels and Tank Assets. Tutorial Content

YouTube Video Link: Attaching a Camera and Creating Explosive Dynamic Slices Using Trigger Areas and Capturing Player Input

These Lumberyard video tutorials walk through using Script Canvas to capture events from Trigger Volumes and Player Input to create different interactions in your scene. This 5-part series is best viewed sequentially.

The following videos cover the 1.14 version of Lumberyard • Script Canvas Tutorial Series Overview (p. 63) • Part 1 - Volume Activated Doors using Trigger Volumes Graph Overview (p. 64) • Part 2 - Add a Button Press to a Trigger Volume (p. 64) • Part 3 - Gate a Trigger Volume with a Button Press from the Input Handler (p. 64) • Part 4 - Modify Material Values from Triggers and Game Events (p. 64) • Part 5 - Use Triggers and Duration Timers to Control Light Visibility and Other Parameters (p. 65)

Script Canvas Tutorial Series Overview Learning Objectives

This is an overview of the player trigger demo. It shows using trigger volumes, handling button presses, and toggling lights and emissive materials by using Script Canvas.

63 Lumberyard Tutorials Lumberyard Tutorials Using Trigger Areas and Capturing Player Input

Tutorial Content

YouTube Video Link: Script Canvas Trigger Volumes, Player Input, and Material Toggles Demo Overview Part 1 - Volume Activated Doors using Trigger Volumes Graph Overview Learning Objectives

In this Lumberyard Video Tutorial you will get an overview of how to use slices, meshes, a timer, variables, and a trigger volume to open and close a door in Script Canvas. Tutorial Content

YouTube Video Link: Volume Activated Doors using Trigger Volumes Graph Overview Part 2 - Add a Button Press to a Trigger Volume Learning Objectives

This is a demonstration that uses the script canvas graph that you created in the previous tutorial. In this demo, a button press from an input handler is attached to the graph. It will familiarize you with using boolean variables, and delay timers to trigger a door opening when the button is pressed. Tutorial Content

YouTube Video Link: Adding a button press to a door trigger volume Part 3 - Gate a Trigger Volume with a Button Press from the Input Handler Learning Objectives

Add an input handler and a few Boolean variables to gate the trigger volume to a button press. Tutorial Content

YouTube Video Link: Gate a Trigger Volume with a Button Press from the Input Handler Part 4 - Modify Material Values from Triggers and Game Events Learning Objectives

Learn how to access and modify different material parameters directly from Script Canvas. In the video tutorial you'll turn on and off lights at runtime by disabling the emissive material on the lights by using the following Script Canvas nodes:

• Find By Name • Find Sub-Material • Set Param Number

Tutorial Content

YouTube Video Link: Modifying Material Values via Triggers and Game Events

64 Lumberyard Tutorials Lumberyard Tutorials PhysX system

Part 5 - Use Triggers and Duration Timers to Control Light Visibility and Other Parameters Learning Objectives

This tutorial continues building on the script canvas graph from the previous video. Learn how to show and hide light entities. This is a common tool used in games with dynamic lighting when you want to lure the player in and then increase the tension by turning off the light in the room. See also how to enhance that to create a flicker effect with the lights in game. You'll do that by learning to work with these Script Canvas nodes:

• Set Visibility • Duration Timer

Tutorial Content

YouTube Video Link: Using Triggers and Duration Timers to Control Light Visibility and other Parameters

PhysX system

The following Amazon Lumberyard video tutorials show how to configure your physics simulation in Lumberyard. For more information, see the Simulating Physics Behavior with the NVIDIA PhysX System in the Amazon Lumberyard User Guide. Series Prerequisites

To perform the tasks described in this tutorial series, the following gems must be enabled in the Project Configurator:

• Primitive Assets • PhysX • PhysX Debug

For information about enabling these gems in the Project Configurator, see Enabling Gems.

Topics • Use the Terrain, Collider, and Rigid Body Components PhysX Components (p. 65) • Create and Apply a Physical Material (p. 66) • Use Collision Filtering in PhysX (p. 66)

Use the Terrain, Collider, and Rigid Body Components PhysX Components Learning Objectives

Familiarize yourself with the PhysX Terrain, PhysX Collider, and PhysX Rigid Body components. Add these components to your entities to give them the ability to interact with the game world simulation, such as falling due to gravity and collisions with other entities.

65 Lumberyard Tutorials Lumberyard Tutorials Create and Apply a Physical Material

Prerequisites

• You must enable the gems listed in the Series Prerequisitessection in this topic.

Tutorial Content

YouTube Video Link: Adding the Terrain, Collider, and Rigid Body PhysX Components Create and Apply a Physical Material Learning Objectives

The following PhysX tutorial video shows how to customize how an entity reacts when it collides with a surface by constructing a physical material. In this example the amount of elasticity is increased causing the ball to bounce when dropped. Prerequisites

• You must enable the gems listed in the Series Prerequisitessection in this topic.

Tutorial Content

YouTube Video Link: Create and Apply a Physical Material Use Collision Filtering in PhysX Learning Objectives

Use the PhysX Configuration menu to configure collision layers and enable filtering between different groups and entities. This can be used to create a ghost behavior that can travel through solid objects. Prerequisites

• You must enable the gems listed in the Series Prerequisitessection in this topic.

Tutorial Content

YouTube Video Link: Using Collision Filtering in PhysX

Editor Python Bindings

These video tutorials show how to work with the Editor Python Bindings and work with the Python Console and run Python Scripts within Amazon Lumberyard.

For more information, see the Automating the Lumberyard Editor with the Python Editor Bindings gem in the Amazon Lumberyard User Guide.

66 Lumberyard Tutorials Lumberyard Tutorials Working with the Python Console

Topics • Working with the Python Console (p. 67) • Writing an Automation Test Python Script (p. 67) • Debug Python Scripts with Wing IDE (p. 67)

Working with the Python Console Learning Objectives

Get an overview of the Editor Python Bindings gem and see how to read in a python script inside of the Python Console. Tutorial Content

YouTube Video Link: How to Load Python Scripts Writing an Automation Test Python Script Learning Objectives

Walkthrough how to write your own python automation script. Tutorial Content

YouTube Video Link: Write a Python Script to Automate Lumberyard Debug Python Scripts with Wing IDE Learning Objectives

This Lumberyard Video Tutorial shows you how to configure Wing IDE and write a bootstrap script to debug Python Scripts within Lumberyard. Tutorial Content

YouTube Video Link: Bootstrap Wing IDE to Debug Python Scripts

User Interfaces

These video tutorials show how to work with the UI Editor to edit UI Canvas components in Amazon Lumberyard.

For more information, see the Creating and Customizing Game User Interfaces in the Amazon Lumberyard User Guide.

Topics • Build an FPS Target with the UI Editor (p. 68) • Construct a Main Menu UI Canvas (p. 68) • Create a Registration Screen (p. 68) • Use String Compares to Add Cheat Codes and Powerups (p. 68)

67 Lumberyard Tutorials Lumberyard Tutorials Build an FPS Target with the UI Editor

• Script an In-Game Timer (p. 69)

Build an FPS Target with the UI Editor Learning Objectives

Start off by importing a texture and creating a UI canvas that you load up to serve as your in-game HUD. Tutorial Content

YouTube Video Link: How to Import a Texture and Map it to a UI Canvas

For more information, see Working with UI Canvases in the Amazon Lumberyard User Guide Construct a Main Menu UI Canvas Learning Objectives

Work with the UI Editor to build a Main Menu screen that accepts keyboard and mouse input using Script Canvas. Tutorial Content

YouTube Video Link: Construct a Main Menu in the UI Editor

For more information, see Using the UI Editor in the Amazon Lumberyard User Guide Create a Registration Screen Learning Objectives

This Lumberyard Video Tutorial shows you how to:

• Create an input field for the player to enter their name. • Listens for the Enter Key or Mouse Click using Script Canvas. • Passes the information using Script Events. • Displays it in the in-game HUD.

Tutorial Content

YouTube Video Link: Create a Registration Screen Use String Compares to Add Cheat Codes and Powerups Learning Objectives

This Lumberyard Video Tutorial builds upon the registration screen by showing you how to use String comparision functions in Script Canvas to activate cheat codes and powerups depending on what the player enters.

68 Lumberyard Tutorials Lumberyard Tutorials Script an In-Game Timer

Tutorial Content

YouTube Video Link: Using String Comparisons to activate cheats and powerups Script an In-Game Timer Learning Objectives

This Lumberyard Video Tutorial concludes the UI Foundation series by showing you how to script in and display a timer that counts down and triggers game over if 0 is reached. Tutorial Content

YouTube Video Link: Build an In-Game Timer that counts down to 0 in the HUD.

Audio and Sound

These video tutorials show how to work with Wwise LTX, the Audio Controls Editor, and the Audio components to work with sound and audio in Amazon Lumberyard.

For more information, see the Adding Audio and Sound Effects in the Amazon Lumberyard User Guide.

Topics • Create a New Wwise LTX Project (p. 69) • Work with the Audio Controls Editor (p. 69) • Work with Ambient Audio using Audio Triggers (p. 70) • Play Sounds on a Motion with Motion Events (p. 70) • Play Character Dialogue with Switch Containers (p. 70) • Audio States and Switch Groups (p. 70)

Create a New Wwise LTX Project Learning Objectives

See how to install and work with Wwise LTX to generate a soundbank for your game project. Tutorial Content

YouTube Video Link: How to Generate a Wwise LTX Soundbank Work with the Audio Controls Editor Learning Objectives

See how to setup your soundbank and play them using Script Canvas and the Audio Trigger Component. Tutorial Content

YouTube Video Link: Play Sound Effects with Script Canvas.

69 Lumberyard Tutorials Lumberyard Tutorials Work with Ambient Audio using Audio Triggers

Work with Ambient Audio using Audio Triggers Learning Objectives

This Lumberyard Video Tutorial shows you how to set an ambient audio track to loop inside of Wwise LTX, and play it in game from the Audio Trigger component without using Script Canvas. Tutorial Content

YouTube Video Link: Loop Ambient Audio using Audio Triggers Play Sounds on a Motion with Motion Events Learning Objectives

This Lumberyard Video Tutorial shows you how queue a Motion Event in a Motion and listen to it from Script Canvas to play a Sound Effect. Tutorial Content

YouTube Video Link: Trigger Sounds from an Animation using Motion Events Play Character Dialogue with Switch Containers Learning Objectives

This Lumberyard Video Tutorial shows you how to play dialogue lines from a character with attenuation so that it fades out over distance as you walk away. Tutorial Content

YouTube Video Link: Play Dialogue from a character with attenuation Audio States and Switch Groups Learning Objectives

This Lumberyard Video Tutorial shows you how to configure your sounds into switch groups and toggle Audio States to change the sounds that play from footsteps depending on the type of ground your avatar is walking over. Tutorial Content

YouTube Video Link: Work with Switch Groups and Audio States

Platform development

You can deploy your executables to mobile devices running Android and iOS. For more information, see the Creating Android and iOS Games in the Amazon Lumberyard User Guide.

70 Lumberyard Tutorials Lumberyard Tutorials Optimize Graphics for Mobile

Topics • Optimize Graphics for Mobile (p. 71) • Deploy Tool Overview (p. 71) • Deploy to an Android Mobile Device (p. 71) • Deploy to the AWS Device Farm (p. 71)

Optimize Graphics for Mobile Learning Objectives

This demonstration covers some of the basic details of the mobile render engine that is used to measure the graphics output on your mobile device. It also describes how you can use the configure different specifications to tune your game to run smoothly on a particular mobile device's hardware rendering capabilities. Tutorial Content

Optimize graphics for mobile Deploy Tool Overview Learning Objectives

See how to use the Deploy tool to deploy games to multiple mobile devices at once, including Android and iOS. Tutorial Content

Deploy Tool Overview Deploy to an Android Mobile Device Learning Objectives

Use the Deploy tool to package your game and send it to your Android mobile device. Note This video covers the Deploy tool in Lumberyard 1.20. Tutorial Content

Deploy to an Android Mobile Device Deploy to the AWS Device Farm Learning Objectives

Use the Deploy tool to package your game, and send it to multiple physical devices on the cloud by using the Device Farm. Note This video covers the Deploy tool in Lumberyard 1.20.

71 Lumberyard Tutorials Lumberyard Tutorials Deploy to the AWS Device Farm

Tutorial Content

Deploy To the AWS Device Farm

72 Lumberyard Tutorials Lumberyard Tutorials

Document History for Tutorials

The following table describes the documentation for the Lumberyard tutorials.

Date Change Documentation updates

October 28, Site launched Amazon Lumberyard tutorials published. 2019

73