I was initially planning to just change my code to work around this and match the velocity from the old character onto the new character. The major problem is that now due to the replacement, the CoreScripts act as if the player respawned (because it technically did) which stops character movement and would fire any CharacterAdded events. Now while this does work, it does bring a few problems to the table, like the camera resetting position, however that is easily fixable. My first approach was simply to clone the new character, delete the old one and set the Player.Character to the new model. Make this a Script(not a local one) and make it the child of the part you want to touch and get the character.įor the camera to follow the newly assigned character, you need to write a script to do that.I’ve recently been inspired by how Genshin Impact handles their party system and wanted to recreate the character swapping system in ROBLOX, however I can’t wrap my head around how I should handle this. Player.Character = workspace.Dummy - write the path to the character you want Local player = PlayersService:FindFirstChild(playerModelName) Local playerModelName = - gets the name of the player model If part.Parent:FindFirstChild("Humanoid") then Here is a sample code: local PlayersService = game:GetService('Players') The model is parented to the Workspace, but may be moved. The Character property contains a reference to a Model containing a Humanoid, body parts, scripts, and other objects required for simulating the player’s avatar in-game. They also won't run when there's a touch event(in this situation). Local scripts don't run when they are a child of a part.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |