Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Whats wrong with my camera script? I cant CFrame my camera on Studio

Im trying to use the command bar to set my cam's CF. Sadly it does not seem to work well. All i do is:

(while in edit mode)

local itemCF = workspace.SpawnLocation.CFrame
workspace.CurrentCamera.CFrame = CFrame.new(itemCF.Position + itemCF.LookVector*10 + Vector3.new(0,10,0),  itemCF.Position)

Instead of looking to the iten, the camera looks to another seemingly random direction

1 answer

my dude you cant change the camera's CFrame while the cameraType is custom you should change it to fixed or Scriptable and when you finish Looking at the item change the cameraType back to custom (learn more about CameraTypes here)

example:

local itemCF = workspace.SpawnLocation.CFrame
wait(3)
workspace.CurrentCamera.CameraType = "Scriptable"
workspace.CurrentCamera.CFrame = CFrame.new(itemCF.Position + itemCF.LookVector*10 + Vector3.new(0,10,0),  itemCF.Position)
wait(5)
workspace.CurrentCamera.CameraType = "Custom"

4 comments

0

I tried but it makes no difference

0

it worked with me though

0

check the output

0

oh and put a wait(3) before changing the camera type to scriptable

This discussion is preserved as it was. New answers, comments, and votes are closed.