How do I add a Trigger Volume to Any Item

From The Endless Mission Wiki
Jump to: navigation, search

Below is a tutorial on how to add a Trigger Volume to any Entity in The Endless Mission.

What is A Trigger Volume?[edit | edit source]

A Trigger Volume is a volume of space that can do one thing when you enter the volume, and another event when you exit it. You may also have the Trigger Volume be destroyed once you enter it, which is helpful if you only want something to happen the first time you enter a Trigger Volume. You can make this volume in the shape of a box, sphere, cylinder, or a capsule.

How to Add A Trigger Volume to An Existing Object[edit | edit source]

Trigger Volume.PNG

This section will detail how you can add a Trigger Volume to any Entity in the Endless Editor. If you do not have a game you are working in, open up "Barebones Game" in the Editor.

  1. Drag in any Entity from the Endless section of your Library into the "Gameplay" section of your Project Hierarchy. Alternatively you can start with an empty Entity by right-clicking on "Gameplay" in your hierarchy and select "Create Empty" from the menu that appears. However, if you start with an empty Entity, you will have no visual indication of where the trigger volume is in your game (which may be desirable in some situations). For this example, we will be using "Roof Block 2x2" as our base entity we will be putting the trigger volume on.
  2. Right click on the Entity that you created in the Editor (in this example it is "Roof Block 2x2"), and select "Create Empty". Rename this Entity you just made to "Trigger Volume Entity". This will be the Entity that has the Trigger Volume attached to it.
  3. In the Endless filter tab of your Library, search for "TriggerVolume". Drag the script titled "TriggerVolume" onto "Trigger Volume Entity" in your Project Hierarchy.
  4. You will now see a small green box appear on "Trigger Volume Entity". This green box is the trigger volume that can fire an "On Trigger Enter" event when you enter it, and an "On Trigger Exit" event once you exit it.
  5. You can now resize "Trigger Volume Entity" by adjusting the scale in its inspector window. You may also reposition "Trigger Volume Entity" independently of whatever it is a child of. In this example, set the scale of "Trigger Volume Entity" to (7,7,7).

On Trigger Enter Endless Event[edit | edit source]

When you add the TriggerVolume script to an Entity, you will see two Endless Events appear, the "Trigger Enter" and "Trigger Exit" events. If you would like something to occur when you enter the trigger volume that you have in your scene, such as make a particle effect appear or make a platform move, you can add that event here.

On Trigger Exit Endless Event[edit | edit source]

If you would like something to happen when you exit this trigger volume, you may put that event here. For example, you may have a light turn on with the "On Trigger Enter" event, and have it turn off on an "On Trigger Exit". This would create the effect of a light only being turned when you are inside of the trigger volume that you created.