Adding Lives System to my game


I am doing the early development of my game at the moment which is a simple block breaker/arkanoid type game and want to program in a lives system where the player starts the game with 3 lives which decreases by one each time the ball is missed by the paddle and a lose scene is loaded once lives reach zero. Also on life being lost I need the ball to reset and rest on the paddle in order to continue the level

Attached is what I have done so far, I am still learning at the moment so I may be miles off point

I have publically exposed a lives component which can be set in the editor however I will probably set this to a default 3 in code, I also want to link to a UI text element to display clearly to the user.

Any help or advice appreciated

Well one its
lives -= 1;

Thanks, any other pointers appreciated

There are lots of cheap plugins out there that will help integrate lives in your game very easily. I recommend “Lives System Pro - Easy Life Integration for Freemium Games” found here Unity Asset Store - The Best Assets for Game Making