player setactive as a Gameobject

Hi everyone. in my 2d game, when the player dies, I set the setactive to false.
and And when I set the setactive to true again, Sounds connected to the player are not played and the player is not recognized by the enemy.
Anyone have an idea for this?
Is there another way to hide the player and then enable it?
thanks.

My only guess is that assuming your player is complex that not everything is being reset to active. Check in the inspector after your game has your respawn if everything to do with the player is active again, not just the main object. Now, as to why that would be happening, I don’t know. Assuming you’re flipping the same active flag, I would presume it would activate/deactive identically, but maybe not. You might have to go through the whole player object and ensure every piece is reactivated separately, although that seems like a bug to me, but it may be intentional, but again that is if that is the problem, I’m just guessing here.

1 Like

thanks for your answer bro.
The cause of the problem was a mistake from me, the Player received the value of z Position from the checkpoint and the z position of checkpoint was set to another number.