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

Are 30 Days of Code Challenges Still Relevant?

Google delete this scam extension.

Yeah! I did, I never thought I would be at this point with the exam having only failed one exam…

Learning Binary Exploitation — 1

Moving On

I’m so excited to introduce you guys to JetSet🤴🏽 (JKM) from Newport Coast, CA!

“Discovering” microservices in Spring Cloud

Keep IT clean — coding good practices: comments

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

What is a Control Track in Timeline

Creating Elevator in Unity — Part 3: Moving Elevator.

Modular Health System in Unity!

Light her up — Adding emissions to your game objects using photoshop and blender