so i made a simple camera manipulation script it does work on the baseplate but not on the disired object ive tried allot of changes but it doesnt work well
im also not the best with camera manipulation, anyways my qeustion is why isnt this code working or what did i do wrong?
local cam = game.Workspace.CurrentCamera
wait(2)
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = workspace.TV:WaitForChild("Screen").CFrame + Vector3.new(0,0,20)
What are you trying to do with the camera? Is it straight up not setting your camera’s cframe or what?
Deciq_z
(Jaafar)
July 20, 2023, 4:02pm
#3
Use RunService . This should do the trick.
local RunService = game:GetService("RunService")
local cam = game.Workspace.CurrentCamera
cam.CameraType = Enum.CameraType.Scriptable
wait(2)
RunService.RenderStepped:Connect(function()
cam.CFrame = workspace.TV:WaitForChild("Screen").CFrame + Vector3.new(0,0,20)
end)
ill test that idk if it will work
This shouldnt be necessary. Since its being set to the same location.
and also im just trying to set the cframe
Deciq_z
(Jaafar)
July 20, 2023, 4:04pm
#7
Well if I don’t use RunService, the camera CFrame will just set once and will return to the player’s character immediately after.
I mean again, you don’t need a renderstepped loop, you can just set it directly.
it dindt work like it keeps saying that it yielded for the tv indecating that the code has run no errors just the yield msg
Deciq_z
(Jaafar)
July 20, 2023, 4:06pm
#10
oh use workspace:WaitForChild(“TV”)
both options dont work it just does nothing
If it’s infinite yielding that means Screen doesn’t exist in workspace.TV
Does your game have streaming enabled? Streaming enabled removes instances from the workspace if they are too far from the player when you are play testing.
do you mean filtering enabled as i dont know what streaming enabled is
well do i disable or check if its on??
Try disabling it and see if the problem persists.
done i disabled it ima see if it works now
this resolved the problem however my camera is facing wrong direction