Why is my camera view change not working?
Asked by
5 years ago Edited 5 years ago
My goal in this game is to have a camera that changes it's view to show kind of an overview of the town during an ending credits scene, my current script goes as followed.
1 | local camera = game.Workspace.CurrentCamera |
(stuff not relating to camera)
1 | camera.CameraType = "Scriptable" |
2 | camera.CFrame = workspace.camview.CFrame |
It is just simply not changing the view, is there any reason as to why this may be happening?
Like did roblox change how the script is supposed to work since I last did this?
EDIT:
I have modified the script to now be
1 | local camera = game.Workspace.CurrentCamera |
2 | local camview = game.Workspace:WaitForChild( "camview" ) |
(split)
1 | camera.CameraType = Enum.CameraType.Scriptable |
2 | camera.CFrame = camview.CFrame |
Still does not work
EDIT 2:
Isolated everything into a game of it's own,
currently my scripts go as follows:
In StarterGui,
LocalTest:
1 | local TouchDetector = game.Workspace.TD |
2 | local module = require(script.Parent:WaitForChild( "ModuleTest" )) |
4 | TouchDetector.Touched:Connect( function () |
ModuleTest:
02 | local replicatedStorage = game:GetService( "ReplicatedStorage" ) |
06 | replicatedStorage.Remotes.Test:FireServer() |
Remote event "test" is fired
In ServerScriptService:
TestScript:
01 | local replicatedStorage = game:GetService( "ReplicatedStorage" ) |
02 | local camera = game.Workspace.CurrentCamera |
03 | local camview = game.Workspace:WaitForChild( "camview" ) |
05 | replicatedStorage.Remotes.Test.OnServerEvent:Connect( function (player) |
09 | camera.CameraType = Enum.CameraType.Scriptable |
10 | camera.CFrame = camview.CFrame |
doesn't work