Why script wont work (client script)

im trying to turn the camera’s position into the “Cutcam” part position but the script that is located in starterplayerscripts wont work:

local cam = workspace.CurrentCamera
local cutcam = workspace.CutCam

cam.CFrame = cutcam.CFrame

Make sure you are setting the camera type to Scriptable so you can control it directly.
Here is a template script that you can modify:

local cam = workspace.CurrentCamera
local cutcam = workspace:WaitForChild("CutCam")

-- wait for the character to load
local player = game.Players.LocalPlayer
player.CharacterAdded:Wait()

-- set the camera type to Scriptable to control it
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = cutcam.CFrame
1 Like

there is a problem in ur script, you defined the player and its character for nothing so it should be this:

local cam = workspace.CurrentCamera
local cutcam = workspace:WaitForChild("CutCam")

cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = cutcam.CFrame
1 Like

I defined the player and it’s character, so the script will run after the character is fully loaded, it’s optional but I like to make sure that everything runs smoothly

no but think about it, u can just use run service, am i wrong?

True, you can use run service for it

1 Like

im a newbie in run service as i am just learning it rn but that’s what ik

I can provide an example if you are interested in using RunService instead of player.CharacterAdded:Wait()

sure you can :slight_smile:
111111111111 charsssssss

There are many ways to do it, but I would do it like this:

local cam = workspace.CurrentCamera
local cutcam = workspace:WaitForChild("CutCam")
local RunService = game:GetService("RunService")

RunService.RenderStepped:Connect(function()
    if game.Players.LocalPlayer.Character then
        cam.CameraType = Enum.CameraType.Scriptable
        cam.CFrame = cutcam.CFrame

        -- disconnect the RenderStepped connection to save up some resources
        RunService.RenderStepped:Disconnect()
    end
end)
1 Like

ty brother and btw i love ur ban module !!

1 Like

Thanks!

random chars ssssssssssssss

1 Like

np brother :smiley:

charsssssssssssszs

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.