Bv1c0n
(rainbow_guy)
1
For some reason, the simple camera script just tells me that CFrame isn’t apart of the camera part even though it’s there in-game
local cam = workspace.CurrentCamera
local camPart = workspace:FindFirstChild("MenuCam")
local mouse = game.Players.LocalPlayer:GetMouse()
repeat
task.wait()
cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable
cam.CFrame = camPart.CFrame
I’m not sure why it does that, this exact script worked before so i’m not sure how this can be fixed
1 Like
vrs2210
(Scandin)
2
Could you try to use :WaitForChild instead?
:FindFirstChild only checks if it exists, :WaitForChild waits for it to exist.
This is due to the Client script running before the world has loaded.
1 Like
Placewith5s
(Placewith5s)
3
If it’s pointing to cam: workspace.CurrentCamera shall work, if it’s in LocalScript only!
If it’s pointing to camPart: workspace:FindFirstChild(“MenuCam”), listen to Kayoh
Fietowski
(Kira)
4
By default, workspace.CurrentCamera will redirect to workspace.Camera, resulting in the same issue if the Camera doesnt exist yet.
1 Like
Fietowski
(Kira)
5
Use
local camPart = workspace:WaitForChild("MenuCam")
as @vrs2210 suggested. The Part doesn’t exist the moment the player joins
1 Like
local Players = game:GetService("Players")
local cam = workspace.CurrentCamera
local camPart = workspace:WaitForChild("MenuCam")::Part
local mouse = Players.LocalPlayer:GetMouse()
cam:GetPropertyChangedSignal("CameraType"):Wait()
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = camPart.CFrame
Bv1c0n
(rainbow_guy)
7
i tried that before and it says possible yields
Bv1c0n
(rainbow_guy)
8
let me see and if it works again hold on
Becouse your game has StreamingEnabled.
Object you are trying to get simply is not streamable.
Put it inside atomic model.
Bv1c0n
(rainbow_guy)
11
I’ve switched it to waitForChild but it still shows infinite possible yields, but i’ll see if putting it in a persistent model works
Bv1c0n
(rainbow_guy)
12
Okay it just says the camera part isnt in the model lol
is there anything else i need to do?
local cam = workspace.CurrentCamera
local camModel = workspace:WaitForChild("CamModel")
local camPart = camModel.MenuCam
local mouse = game.Players.LocalPlayer:GetMouse()
repeat
task.wait()
cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable
cam.CFrame = camPart.CFrame
Can you clarify that you infact have streaming enabled?
If so is model streaming behavior Persistent?
1 Like
Bv1c0n
(rainbow_guy)
14
where can i check that btw? sorry for not clarifying earlier lol
edit: nvm i found it
Bv1c0n
(rainbow_guy)
15
okay it works tysm for the help dude
1 Like
system
(system)
Closed
16
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.