Health System
A downloadable asset pack
Download NowName your own price
Simple Health System
A lightweight and easy-to-use health management system designed for Unity games. This system provides essential components for handling health, applying damage, and displaying health UI elements dynamically.
This is mostly made to make the prototype of your game easy but if you want to use it on the full version go-ahead
Features
- Health Management – Easily track and modify health values.
- Damage System – Apply damage dynamically with adjustable values.
- Health UI Integration – Display real-time health bars for visual feedback.
- Event-Driven System – Trigger actions based on health changes.
- Lightweight & Modular – Simple to integrate into any Unity project.
- Sound Effects – Add damage and death sounds for enhanced gameplay feedback.
Setup Instructions
1️⃣ Assigning Components
- Attach the HealthSystem component to any GameObject that requires health management.
- Add the DamageSystem component to objects that deal damage, adjusting values through the Inspector.
2️⃣ Setting Up Health UI
- Add the HealthBar prefab to the Canvas.
- Attach the HealthUI component to the same GameObject as the HealthSystem.
- Drag and drop the HealthBar prefab into the assigned field in the HealthUI component in the Inspector.
3️⃣ Adding Sound Effects
- Assign damage sound effects into assigned field on DamageSystem component.
- Assign death sound effects into assigned field on HealthSystem component.
4️⃣ Modify the Die Function
Here's how you can customize the Die function in your HealthSystem
to modify the behavior after death:
private void Die() { if (isPlayer) { // Change this for when the player dies if (deathMenu != null) { Time.timeScale = 0f; // Pause the game deathMenu.SetActive(true); // Show the death menu } } else { // Change this for when it's not the player if (destroyGameObject) { Destroy(gameObject); // Destroy non-player object } else { Debug.Log($"{gameObject.name} has died."); // Log death for non-player } } PlayDeathSound(); // Play sound effect after death }
Customization Options:
- For Player Death: The default behavior pauses the game and shows a death menu (if provided in the inspector). You can replace this with custom behavior like restarting the level or playing a specific animation.
- For Non-Player Death: You can decide whether to destroy the object (
destroyGameObject
) or log the death in the console. You can replace it with other effects like spawning an enemy corpse or triggering events.
📌 Requirements
- Unity Engine 6000+ (Tested with version 6000.0.35f1)
- Basic understanding of Unity scripting and components
📜 License
MIT License
Copyright (c) 2025 Sillylix
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
🤖AI uses:
I used AI to help me write the description as my English isn't that good.
Published | 18 hours ago |
Status | Released |
Category | Assets |
Author | SillyLix |
Tags | Asset Pack, health, heathsystem, sourcecode |
Download
Download NowName your own price
Click download now to get access to the following files:
HealthSystem.unitypackage 40 kB
Leave a comment
Log in with itch.io to leave a comment.