I’m attempting to create a cutscene in my game in which the local player can see their character model. I have cloned the character via a local script, but I cannot get past the error: “attempt to index nil with parent”. The script follows a remote event, by which a server script fires an event to the local script in question.
Below is the script under scrutiny:
local Start = game.Workspace.AgentCutscene["AgentCutscene - NPCStart"]
local Destination = game.Workspace.AgentCutscene["AgentCutscene - NPCDestination"]
game.ReplicatedStorage.AgentCutscene.onClientEvent:Connect(function()
print("event received")
local Dummy = game.Players.LocalPlayer.Character:Clone()
Dummy.Parent = workspace
Dummy.Position = Start
end)
Is there a way to clone all of the model’s children in the process as well? A character’s position as an object cannot be determined, so I must take its HumanoidRootPart, which doesn’t exist in the cloned model.
May I ask what are you aiming for by cloning player models? As I said, Roblox discourages it probably for a good reason
If you still really need to, you might need to end up writing your own custom cloning function that manually scans over properties and transfer them over into a new instance
This is to do with a cutscene in which the player’s avatar is seen in my game. Since this is a multiplayer experience, a single object must be the framework upon which the client’s character can be seen. Essentially, each client in the server will see their own character on the screen.
If you really need to, you can set the model’s primary part to the torso or wherever you want to pivot the model from, and then change the position of that part.