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.

local camera = game.Workspace.CurrentCamera

(stuff not relating to camera)

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

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

(split)

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

local TouchDetector = game.Workspace.TD
local module = require(script.Parent:WaitForChild("ModuleTest"))

TouchDetector.Touched:Connect(function()
    module.Test()
end)

ModuleTest:

local module = {}
local replicatedStorage = game:GetService("ReplicatedStorage")

function module.Test()

    replicatedStorage.Remotes.Test:FireServer()


end

return module

Remote event "test" is fired

In ServerScriptService:

TestScript:

local replicatedStorage = game:GetService("ReplicatedStorage")
local camera = game.Workspace.CurrentCamera
local camview = game.Workspace:WaitForChild("camview")

replicatedStorage.Remotes.Test.OnServerEvent:Connect(function(player)

    wait(1) --not in actual game, just to simulate a delay

    camera.CameraType = Enum.CameraType.Scriptable
    camera.CFrame = camview.CFrame
end)

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