I think the old bodies lying around is pretty cool, as long as they can’t break anything (block entrances, etc.)
I work as a software developer, but take my advice with a pinch of salt, because I’m not much of a game developer.
HP is a property of the player, and so it belongs with all the other player properties (position, scale, rotation, etc.).
Respawn is a bit more difficult. If you have it as a method on the player, then you can easily update the HP and position. You’d probably lose the dead bodies by doing that, unless you Instantiate()
a new player object. That might cause weirdness when it comes to controls and things like that.
Just try to keep things in the place they logically belong. If the player has health points, then HP belongs to the player. If something else needs to know the HP (your health bar) then it will need to be able to reference the player to get it.
Coupling those GameObject
s together seems to be a pretty common thing to do in Unity, so that’s probably fine for now, even though I’d usually say to avoid tightly coupling independent objects. Most typical solutions are going to be huge overkill for your game in the next week or so. :)
For tutorials, I’d say to find one that is producing something just like what you’re working on, and stick with that for examples/inspiration. Trying to follow more than one will probably just jumble things up, like you said. See if you can find one with the source code available for close inspection.
I think you’re doing great, and the best thing you can do is practice!