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

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.

1local camera = game.Workspace.CurrentCamera

(stuff not relating to camera)

1camera.CameraType = "Scriptable"
2camera.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

1local camera = game.Workspace.CurrentCamera
2local camview = game.Workspace:WaitForChild("camview")

(split)

1camera.CameraType = Enum.CameraType.Scriptable
2camera.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:

1local TouchDetector = game.Workspace.TD
2local module = require(script.Parent:WaitForChild("ModuleTest"))
3 
4TouchDetector.Touched:Connect(function()
5    module.Test()
6end)

ModuleTest:

01local module = {}
02local replicatedStorage = game:GetService("ReplicatedStorage")
03 
04function module.Test()
05 
06    replicatedStorage.Remotes.Test:FireServer()
07 
08 
09end
10 
11return module

Remote event "test" is fired

In ServerScriptService:

TestScript:

01local replicatedStorage = game:GetService("ReplicatedStorage")
02local camera = game.Workspace.CurrentCamera
03local camview = game.Workspace:WaitForChild("camview")
04 
05replicatedStorage.Remotes.Test.OnServerEvent:Connect(function(player)
06 
07    wait(1) --not in actual game, just to simulate a delay
08 
09    camera.CameraType = Enum.CameraType.Scriptable
10    camera.CFrame = camview.CFrame
11end)

doesn't work

0
try calling a wait for child before "camview". also do camera.CameraType = Enum.CameraType.Scriptable Si_SenorTN 25 — 5y
0
That didn't work, I did both, still just doing nothing JoinMyWorld 2 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

ok I solved it,

what I had to do was enable a script in StarterGui and used pretty much the same code but in that script.

either I'm stupid or roblox is stupid but I fixed it.

Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

This tutorial worked for me, it will probably help to clear things up. https://www.youtube.com/watch?v=bkDp4fRbVZU

Answer this question