I am trying to make a cutscene system and I need the camera to be on the face of the PlayerCopy’s head. Whenever I join and touch the part which makes it function, it just puts the camera to the spot where the original head position was at. If you can I will be very greatful if you help me fix this issue.
local camera = workspace.CurrentCamera
local part = game.Workspace.PlayerCopy:WaitForChild("Head")
local Event = game.ReplicatedStorage.Events:WaitForChild("OpeningCutscene")
Event.OnClientEvent:Connect(function()
game:GetService("RunService"):BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value,function()
script.Parent.Disablewakeup.Disabled = false
camera.CoordinateFrame = part.CFrame
camera.Focus = part
end)
end)
That is because camera.Focus is a CFrame property, and you are setting it to the part (an instance). Instead, try maybe camera.Focus = part.CFrame, or something along those lines
I tried that and it stops the errors but it still only goes to the original spot where the head was. It is suppose to play an animation which it does its just the head stays stuck. If it is the touch button the code is:
local Event = game.ReplicatedStorage.Events.OpeningCutscene
local PlayerCopy = game.Workspace.PlayerCopy
local animation = PlayerCopy:WaitForChild('Animation')
local humanoid = PlayerCopy:WaitForChild('Humanoid')
local PlayAnimation = humanoid:LoadAnimation(animation)
script.Parent.Touched:Connect(function()
script.Parent.CanTouch = false
wait(0.2)
Event:FireAllClients()
PlayAnimation:Play()
end)