Search Unity

I want to implement a power up system into my endless runner game like subway surfers.

Discussion in 'Scripting' started by Deleted User, Nov 27, 2019.

  1. Deleted User

    Deleted User

    Guest

    I want to implement a power up system into my endless runner game like subway surfers,how do i go about it?
     
  2. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    Just like coins collectible, but change some avatar or game params like speed or animation or x2 score given
     
  3. Emolk

    Emolk

    Joined:
    Feb 11, 2014
    Posts:
    241
    Create prefabs for each powerup, variants of a base powerup prefab

    Create a script that applies different effects based on which bools are checked and add it to the base powerup prefab. Then you can simply switch different bools to apply different effects.

    Eg. you want to make a powerup that doubles your speed and energy?

    Check the speedup and inceasedEnergy bools on the prefab variant

    Then when the Player collides with a prefab check all of its bools and apply the ones that are checked.

    eg. if speedUp is checked, double the Player's speed for a duration.

    I'm sure there's a better way to do this but that works nonetheless.