Phase 2: Negative Pickup

Objective: Create a power-up that negatively affects the player. I have chosen to negatively affect the player by slowing the speed.

Demo

Ok, the first thing to do is create the power-up game object. I will name it Negitive_Powerup. Also, we will need to add a rigid body(set gravity to 0), circle collider(set as a trigger), and add the power-up script. In the power-up script, I will set the speed and power up ID.

Next, we will update the Player script, the first is to set a bool to turn on and off the negative powerup.

Next, we will create the method to set the bool to True and call the cooldown IEnumerator.

In the CalculateSpeed Method I will check for the _isNegativeBoostActive.

The last thing to do is call the NegativeBoostActive method when the Player collides with the Negative PoserUp.

Lets see this is action

Demo

Happy Coding!!!

--

--

--

Unity / C# Game developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

ALC 4 Cloud Challenge Phase II using GCP Virtual Machine

Finally! Google launched Gboard to replace the old keyboard

Integrating WebRTC in Flutter Simplified using Janus Gateway and flutter janus client

Free Self-Hosted Zendesk & Help Scout: Architecture, Design and Usability

Make Notion Run Faster on macOS or Windows by Installing the Progressive Web App

Contributing to pandas

Hybrid Media Player in Flutter

HalfStack Online Chat with Now4Real

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
Bill Rislov

Bill Rislov

Unity / C# Game developer

More from Medium

Point and Click Controller in Unity

Upgrading Controls on a Forklift to the new Unity Input System

Quick tip — Upgrading your Unity project to High Definition Render Pipeline (HDRP)

2D Mobile: Loot System