I added a death animation among some other things in case of death. But after playing it the player is airborne, so I might need to change the pivot. But I'm wondering if this can't be done with some code
The player's death is then handled by this code:
private void Die()
{
Debug.Log(gameObject.name + " died.");
isDead = true;
isRegenerating = false;
//gameObject.SetActive(false);
player.AnimController.SetDeathState();
WorldController.Instance.isGameOver = true;
if (WorldController.Instance.ghostModerEnabled)
{
WorldController.Instance.isGhostMode = true;
}
//Destroy(gameObject);
}
I originally thought it might be enough to manipulate the collider on the player to lay down along with the animation so the player stays lying in the air, but that doesn't really work
Edit: 0
The collider in the event of death does not exactly match the position of the player's body. Overall, it looks like this.
The player's character is made up of an empty object containing the character model from the mixamo. All scripts and the capsule collider broadcast on the empty object presenting the player. I know the colliders should look different. But it's something I haven't addressed yet. In case of death, the capsule collider stays in its original position. I tried applying the collider to the character model as well, but the situation is basically the same.