Hi,
I would like to make a copy of dead player (different position simulated by ragdoll) to make the corpse available to loot. At the same moment the body “owner” could be already respawned. I don’t want to instantiate new player character after each death, and don’t think that is correct way for that task.
What is the best way to “copy” body and its position? Only what can I assume is Instantiate a clean prefab containing only character model and set each bone position the same as original body position. But that looks a dirty way…
IMO your dirty way is the most clean way
That sounds as compliment for me )) Looks like there is no other way
The only other way that that you could go was to sepreate the “visuals of a player” into a model of its own and the have the logic of a player being the thing respawned, that way you can just detatch the visuals of the player where he died and put a “DeadPlayer” script on it instead and remake an instance of GameObject.Instanciate with a PlayerGraphics Prefab on it. However, That might require too much work on refactoring your code and design so i believe that the other solution is much better in your case. There is no “right” or “wrong” way to do it, however I do like to try and keep things simple and In that case I like the method that your started doing because it feels to be more error prone and will not mess up other logic, even through you have errors in the genenerated dead player it will be contained to just that “sub-system”
1 Like