Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is CameraType inconsistent within game and studio?

Asked by 4 years ago
Edited 4 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

I have a problem, I want to display a preview of the main area in-game when the main menu is up, this is a feature you'd see in a lot of games, however, when I playtest it in studio, it's completely fine, but when I join the game it breaks somehow, and the camera is on your character (Custom).

This is what I see when I playtest it in studio: https://imgur.com/a/TLtXBKm

And this is what I see when I join the game: https://imgur.com/a/gS8MKZl

This is the code I have written to change the CameraType:

local camera = workspace.CurrentCamera
local camera_target = workspace.CameraParts.IntroCamera

camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = camera_target.CFrame

camera:GetPropertyChangedSignal("CameraType"):Connect(function()                                          
    camera.CameraType = Enum.CameraType.Scriptable                                                                 
end)

What can I do to prevent this inconsistency?

Answer this question