Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //bool
- [SerializeField] bool immortal;
- public void TakeDamage(int damage) {
- //add this if
- if (!immortal) {
- health -= damage;
- // print($"{gameObject.name} Ouch, that hurts {health}");
- if (health <= 0) {
- characterStateMachine.Die();
- }
- }
- }
- //pause at runtime and check the immortal bool
Advertisement
Add Comment
Please, Sign In to add comment