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

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

Just like coins collectible, but change some avatar or game params like speed or animation or x2 score given

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.