This package features several scripts and a UI widget for the creation of an elevator-like teleportation system which allows the players to select which floor they want to teleport to.
The package is designed to work with a fairly specific entity organization. The idea is that these “elevators” are to be grouped together to create a single unified system for control and identification purposes.
Start with an “elevator car” design, like a voxel mesh, that can be duplicated as many times as you need floors to stop at. Within this design, add a mesh to serve as the interactable keypad, and a locator to identify the “floor” that this car represents. Then, group these elevator cars under a single Locator.
Locator Parent Elevator Car Locator Interactable Mesh Elevator Car Locator Interactable Mesh Etc...
Now you can move the entire elevator system, or add new elevator cars to the system by duplicating and adding the new cars to the stack.
- ElevatorKeypad - Place this on the interactable mesh in the elevator car.
- ElevatorController - Place this on the top-level parent Locator. There are four properties here, discussed below.
- ElevatorUIHandler - Place this on the USER template.
- ElevatorMenu (widget) - Place this on the USER template.
- ElevatorCode - This unique ID allows for several elevator systems to exist in a world. If you have more than one system, each system should have a different code (this prevents travel from System A, floor 1 to System B, floor 2, for example)
- FloorLocators - This array tracks the teleportation locators in the elevator system. Use the “+” button to add as many entries as you have floors, and then select the locators for each floor. IMPORTANT! The system uses the array order to determine the floors, not the locator position in the world or in the world tree.
- FloorChangeAudio - A sound to play when the transition occurs.
- OnFloorChange - An event raised when the floor transition occurs.