Framework 1: Creating an Elevator

Creating an Elevator system that works with a total point activation

Preparing the Elevator and the Elevator Panel

The Elevator setup which I have is proudly provided by GameDevHQ’s Filebase courses. It comes with a lift, a back plate that provides an illusion of an elevator track and also an terminal.

The provided Lift + the Terminal 3D asset

The Script

We are going to create 2 C# scripts, one for the Elevator Control Panel, which will check if the player has enough points to activate the elevator, and also the ability to toggle the elevator movement. The second script will focus on the elevator lift itself, such as the movement.

The Elevator Panel Script:

First in the elevator panel, we are going to reference two variables, first to the light capsule, second the total required points to trigger the elevator.

Both the Player script reference and Elevator Lift script aren’t located because they are implemented yet.

Player Script:

In the player script, we are quickly going to add in the public method which was referenced by the Control Panel “total Points”. Since the player already has the points data, all we have to do is create a public method which we can return the value.

Elevator Lift Script:

In the elevator lift script which is attached to the actual Lift. We are going to first make several variables, one for the two target positions, one Float variable for the lift movement speed, and finally an bool for an future boolean switch.

--

--

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simon Truong

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.