::Could you send your PlayerController script’s Death()
method code? And can you check your Console to see if there are any errors while in death?
The reason behind why your player is falling is due to us turning off the boxcollider2D with the line GetComponent<BoxCollider2D>().enabled = false;
in the method. Thus, the player no longer has collision detection and falls through the floor. I added this code to prevent other enemies or moving structures from pushing the player’s corpse around.
However, because the player can fall through the floor, i also added a code rb.constraints = RigidbodyConstraints2D.FreezePosition;
to freeze the player’s position when they die, so that they would not move in death animation.
Therefore, either your Death()
method does not include the rigid body line, or you encountered an error with the code.
As for your shade, it’s likely only falling due to the player fphasing through the ground first and then spawning the shade while under the ground.
So, I have a feeling that the shade will be fine when the player is fine.