hey, I’m trying to make a “smooth” character morph, but it isn’t really working properly
--normal script
morph:FireClient(player, 1) --first remoteevent call
player.Character = morph_char
if playerRoot and cloneRoot then
local playerRoot_CFrame = playerRoot.CFrame
playerRoot.CFrame = cloneRoot.CFrame
cloneRoot.CFrame = playerRoot_CFrame
print("morphed")
else
warn("Player not able to be morphed")
end
morph_char.Parent = workspace
morph:FireClient(player, 2) --second remoteevent call
character:Destroy()
--local script
local tool = script.Parent
local morph = tool:WaitForChild("morph")
local camera = workspace.CurrentCamera
local angle = nil
morph.OnClientEvent:Connect(function(func)
print("fired")
if func == 1 then
angle = camera.CFrame
print(angle)
elseif func == 2 then
camera.CFrame = angle
print("changed!")
end
end)
not sure why this is happening, could anyone help me out?
thanks in advance!
What part of your code has worked so far? Im confused why you’ve set the playerRoot_CFrame to playerRoot.CFrame whats that do, also why have you set the morphChar.Parent to the workspace after you set the players character? Also whats the goal? Why have you put the morph client script in a tool?
Its good practice to put scripts in starterplayerscripts it makes no sense for the player to have a random tool that doesn’t function, its also better for later if you need to edit the script so you dont need to go through loads of tools to find the right script.
It could be that its not working because if you have the tool equipped when the event is fired then your character would have changed and would not have passed on the tool with the local script - which is why you should keep them in starterplayerscripts.
nevermind I was wrong, it works after I put it in sps, but now I’m trying to set the CFrame of my camera in the Custom cameratype, which isn’t going very well.
Could you help me out?