My character dying animation works and when the character lies on the ground, text appears saying "Wasted". I added an object and it respawns.
The main problem is that although he respawns, the character still plays the death animation on the ground after respawning in the new location, as shown in the animation below:
using UnityEngine; using DG.Tweening; using UnityEngine.UI; using UnityEngine.SceneManagement; public class Health : MonoBehaviour { public float curHealth; public float maxHealth; public bool enemyDied = false; private Animator anim; public Slider healthBar; private ThirdPersonCharacter thirdPerson; private void Start() { curHealth = maxHealth; healthBar.minValue = 0; healthBar.value = curHealth; healthBar.maxValue = maxHealth; anim = GetComponent<Animator>(); thirdPerson = GetComponent<ThirdPersonCharacter>(); } void Update() { float hit = anim.GetFloat("hit"); if (hit > 0) { hit -= Time.deltaTime * 3; anim.SetFloat("hit", hit); } if (curHealth < 1) { Physics.SyncTransforms(); anim.SetBool("death", true); } if (Input.GetKeyUp(KeyCode.Space)) { SendDamage(Random.Range(10, 20)); } } public void SendDamage(float damageValue) { curHealth -= damageValue; healthBar.value = curHealth; if (curHealth <= 0) { enemyDied = true; } Invoke(nameof(Resurrect), 2f); anim.SetFloat("hit", 1); } public void Resurrect() { SpriteRenderer blackout = Camera.main.transform.GetComponentInChildren<SpriteRenderer>(); Color orjinalRenkWasted = blackout.color; Color clrWhitealpha0 = new Color(1, 1, 1, 1); Color clr = new Color(0, 0, 0, 1); blackout.transform.GetChild(0).GetComponent<SpriteRenderer>().DOColor(clr, .5f).SetDelay(2f).OnStart(() => { blackout.DOColor(clrWhitealpha0, .5f).SetDelay(.5f).OnComplete(() => { Invoke(nameof(BringEverythingBack), 2f); blackout.transform.GetChild(0).GetComponent<SpriteRenderer>().DOColor(new Color(0, 0, 0, 0), .5f).SetDelay(2.5f).OnStart(() => { blackout.DOColor(orjinalRenkWasted, .25f); }); }); }); } void BringEverythingBack() { transform.root.position = GameObject.FindGameObjectWithTag("Respawn").transform.position; } 
anim.SetBool("death", true);- do you ever set this to "false" anywhere? Do you have a transition out of your death animation back into your regular alive animations? Do you ever resetcurhealthso you don't immediately die again? \$\endgroup\$curHealthback to a value at or above 1? Be sure the answers to this are visible in your question. \$\endgroup\$anim.SetBool("death", false), but you did not do that, instead deleting useful parts of the question. This is considered vandalism and an abuse of the edit feature to bump a post without clarifying it. A pattern of abuse like this can result in restrictions to your account, so please follow instructions and do not make meaningless edits in the future. \$\endgroup\$