Creating Physical Objects with Ability for Combat Damage and Destruction
Tutorial Video: Building a Game
- Part 1: Creating Physics Moveable, Static Environment, and Non Physical Objects @ Time 4:37-9:07
- Part 2: Creating Descructible Objects through Entity Abilities @ Time 11:05-14:05
Part 1: [Video Segment: 4:37-9:07] Creating Physics Moveable, Static Environment, and Non Physical Objects
For the next part of this tutorial, we will experiment with Entity Physics settings and types, to learn how to configure these to create the desired behavior in games. Our object of focus will be a "Rustic Barrel", as we alter it's physical attributes.
- First switch to Design Mode (F2 toggles).
- Now drag-drop Barrel into the Scene. From Asset Explorer, type "barrel" into the search bar, and find the "RusticBarrel" in the tree view (Figure 4-1).
- In the scene view, select the barrel with left-click.
- To witness it's default properties, in Design Mode, press SHIFT and left-click the barrel while dragging the mouse upwards, and see the barrel raise off the ground. (Figure 4-2)
- Now press F2 to switch into Run mode, and you should see the barrel fall to the ground. This is it's default behavior.
- Now press F2 to switch back into Design Mode, and repeat step #4 again (raise it back into the air).
- Now look at the Object Editor, and open click the "Physics" bar to open up these properties. (Figure 4-3)
- Change the Object Type from "MoveableObject" to "None", then switch back to Run Mode, and note that the barrel no longer falls to the ground.
- Now Take Control of your AssaultDroid (added above) by double-clicking him while in Run Mode. Use the Droid to fire a missile at the barrel and notice how it passes right through the barrel.
- Now change the Barrel's "Object Type" to "Obstacle" and switch back into Run Mode.
- Have your Droid fire again at the barrel, and this time, note how the missiles strike the barrel and explode. After about 3 hits, the barrel is destroyed.
- Repeat step #2 above to drop in another barrel.
- Now have the droid again fire at this barrel, and note how when the missile strikes it, the barrel responds by flying away from the blast. This is because the Barrel, by default, is a MoveableObject.
- Repeat step #2 again, and change it's Object Type to "Obstacle" so that it does not move.
- Select the barrel, and in "Object Editor" open up the "Abilities" bar, and then open the "GameParameters" element. (Figure 4-4)
- Uncheck the "Can Be Damaged" property (so that it's no indestructible!).
- Now fire the droid's missile again at the barrel, and note how the barrel is never destroyed.
- Now recheck the "Can Be Damaged" and edit the "Hit Points" and "Max Hit Points" properties to be 2000 each.
- Now fire the droid's missile repeatedly at the barrel, and watch how the "Hit Points" are decreased with each hit. When it reaches zero, the barrel will be destroyed.

(Figure 4-1: Find "RusticBarrel" using Asset Explorer, so that you can drag/drop it into the scene view.)

(Figure 4-2: Rustic Barrel in Design Mode, raised off the ground using SHIFT + LeftClick + Drag upwards with mouse.)

(Figure 4-3: Barrel Physics properties, shown in Object Editor.)

(Figure 4-4: Barrel Abilities -> GameParameters Element, permits you to modify Destructible properties.)
Part 2: [Video Segment: 11:05-14:05] Creating Descructible Objects through Entity Abilities
- Drag drop Box.mesh on scene.
- Create New Actor dialog: Select obstacle type.
- Change type on Movable Platform and test physical properties.
- Adding GameParameters ability for destruction demonstration: drag drop GameParameters ability from AE->Scripting->AI->Abilities on box entity in WE.
- Shoot at box and destroy it.