I want to implement a power up system into my 2d platformer but instead of the power ups just offering extra speed or a health replenishment my power ups will be like totally different characters with different sprites, sizes and abilities (e.g inverting gravity, shooting lasers, climbing on walls, etc.).
At the minute i'm just going to try getting the player to change to a different power up. Does anyone have any idea how I could do this? I'm thinking destroy the player when they come in contact with the power up and then spawn a new player, with the new ability, in it's place but i'm not sure.
Hi Zak if you want to sell only characters I think you need to keep prefabs for every character in Resources folder. When the player buy character you just need to replace current character's prefab path and load it from resources when needed.
For power ups like climbing or gravity reversing you need to write scripts for each powerup and attach to current character when player buy it. You can manage power ups like showed below.
If you want to sell sprites. You need to keep sprites in Resources folder and when the player buy cloth you just need to replace cloth path of current character.