Objective: Create a pick up that helps our player regain some lives lost.
Step 1: Create the item to spawn that will be used to trigger the life gain. Remember to give it a rigidbody and collider like all the other powerups have.
Step 2: Assign the powerup script to it and set it’s number to match the new case which for my instance is 5 and add it’s case in the powerup script.
Step 3: Create a new spawn routine for this powerup to help limit it’s spawn rate to provide balance.
Step 4: Assign the new object to the spawn manager
Step 5: Create the variable needed to keep track of max life vs current life. Then set maxlives in player start
Step 6: Create the method triggered by the pick up and remember to include the ui update to reflect the change and add in the engine damage effect states
Final: With this set you should have an extra life spawn every 12 seconds this of course can be adjusted over time as needed.