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
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
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
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
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
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)
ty brother and btw i love ur ban module !!
Thanks!
random chars ssssssssssssss
np brother
charsssssssssssszs
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.