Part 1 — Press the button and change color

Split up functionality for easier and faster development

We want various functions for our elevator. We want a pressable button that changes color, a requirement of enough collectables collected and a elevator that only starts moving when called. A simple thing…

How to create a lives and respawn system

Pseudocode

if the player hits the death zone trigger
then decrease lives
then update the UI lives display
then respawn at respawn point
if lives is zero or less
then reload the current scene

Death Zone

Create a…

How to move Player along with the Moving Platform

Pseudocode / logic

To do make our player move along with the platform we will make the player a child object of the moving platform while it’s on it.

How to create a moving platform in Unity

Moving Platform Script

We use game objects with just transform components as a reference. Our…

Physics Based Character Controller part 4

Double Jump Script

A new variable to keep track if we already double jumped or not.

private bool _doubleJumped;

Physics Based Character Controller part 3

Physics Based Character Controller part 2

void Update()
{
Vector3 direction = new Vector3(Input.GetAxis(“Horizontal”), 0);
Vector3 velocity = direction * _speed;
if (_controller.isGrounded == true)
{
//do nothing
}
else
{
velocity.y -= _gravity;
}

_controller.Move(velocity * Time.deltaTime);
}

Tristan Engel

Aspiring developer that’s self-learning Unity & C# to transition to a career with Unity. I got a passion for creating interactive experiences.

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