I am making a game in which I need the player to control a different character. Basically, when a certain event triggers, it should pick a random character and then switch the character to become it.
In the game, when you die, you possess another character model, I just need to know how to make it control the new one and switch to so that character is that new model.
Player dies > Game finds a new model within a distance > camera changes to that model and player can now use that to move.
Help is very much appreciated, thanks for reading!
If you use ApplyHumanoidDescription on the playerâs humanoid, you can set their characterâs appearance to that of another UserId.
This is pretty much the best solution I can come up with in regards to your issue.
local humanoid = -- humanoid of the player
local id = -- user id of the player who has the humanoid model you want to set to the player
local humanoidDescription = game.Players:GetHumanoidDescriptionFromUserId(id)
humanoid:ApplyDescription(humanoidDescription)
I mean that when the player dies, they physically control a different player model. Like the camera goes to a different model and then the player controls it. Like the playerâs âconsciousnessâ goes to another model.
I have already done some of this in my game, and I noticed that you should really never give the player control of a character they do not own (another playerâs character) you should instead fake it with HumanoidDescriptions.
For me, the player is a weeping angel and when they are being looked at, they get teleported to and control a weeping angel that is not being looked at. Could I effectively fake it by just setting the cframe of the player to the weeping angel model, and then delete the model? And when the players get looked at, they get cloned without humanoid and then the player gets switched?
Weâll how I do it is by setting the Playerâs cameraSubject to the model and since the character model isnât another player you could fork the PlayerControl scripts and edit it to your liking.