I want to create a system or rather a script that, when triggered by a ProximityPrompt interaction, replaces the player’s character with a cloned morph model.
The provided script doesn’t seem to work as intended. When the ProximityPrompt is triggered, the player’s character doesn’t switch to the cloned morph model
Video:
I have attempted to modify the original script to correctly handle the character switch and camera focus. I also incorporated error handling and added print statements to debug any potential issues. However, despite these efforts, the script still does not produce the desired results.
Here’s the current version of the script I’m using:
local model = script.Parent
local prompt = model.Prompt.ProximityPrompt
prompt.Triggered:Connect(function(player)
local oldCharacter = player.Character
local morphModel = model:FindFirstChildOfClass("Model")
local newCharacter = morphModel:Clone()
newCharacter.HumanoidRootPart.Anchored = false
newCharacter:SetPrimaryPartCFrame(oldCharacter.PrimaryPart.CFrame)
player.Character = newCharacter
newCharacter.Parent = workspace
end)
If anyone has insights or suggestions on why this script might not be working as intended, or if there’s a more effective way to achieve the desired behavior, your help would be greatly appreciated!
I will show hierarchy and properties of my characters model on the chance the script is working correctly though the model may have insecurities.
Here is the hierarchy of the model, with the corresponding properties for the model itself, take note that all of the parts are unanchored, and can collide is true for each part and mesh below I will attach a photo of the humanoid properties. Though it may be hard to see, the PrimaryPart of the character is the HumanoidRootPart.
The following Image contains the properties for the Humanoid object.
Thanks