[#10] Teleportation Controller

STYLY comes with a default plane collider that covers the entire floor of the world. However, we only want the user to be able to teleport on the game arena and not beyond its borders. We also want the bullets to fall off the stage, so this plane needs to be removed. To do this, first create an empty Game Object in the Scene Hierarchy and name it “teleportController”.

Next create an FSM and add a starting state called “Destroy Plane”. In this state, add two actions. The first is a Find Game Object action to locate this plane, aptly named “plane”, and store it in a variable called plane, and the second is to destroy the plane. This can be accomplished with a Destroy Object action, as shown in the picture below. Make sure to set the plane variable we just created as the target to be destroyed.

Finally, we move on to creating the stage.