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

Why doesn't my camera manipulation script reset when requested?

Asked by 6 years ago
Edited 6 years ago

I have a camera script which I created here.

Once an event is fired from the server, it checks to see whether the server has requested for the manipulation to be enabled, or disabled.

When the server requests for the manipulation to be disabled, the manipulation doesn't reset, and as such the player doesn't gain control of the camera.

Is there anything in the script that may be causing this?

01ReplicatedStorage = game:GetService("ReplicatedStorage")
02CameraEvent = ReplicatedStorage:WaitForChild("CameraEvent")
03Camera = workspace.CurrentCamera
04Players = game:GetService("Players")
05Player = Players.LocalPlayer
06 
07function Event(status)
08    if status == "Stop" then
09        Camera.CameraSubject = Player.Character.Humanoid
10        Camera.CameraType = "Custom"   
11    end
12    if status == "Use" then
13        Camera.CameraSubject = workspace.JudgeBrick
14        Camera.CameraType = "Scriptable"
15        game:GetService('RunService').Stepped:Connect(function() -- On
View all 21 lines...
0
Just to clarify also - I am firstly requesting for the camera to be manipulated, then for it to be reset. This happens in my server script. TruDevek 40 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

if you want to reset you can also just disable the camerascript, then goto line 09 and 10 Camera.CameraSubject = Player.Character.Humanoid Camera.CameraType = "Custom"

then you can enable it back when clicked, this is my camera script (When I click a gui button I disable this):

01local target = workspace.GameParts.Misc.CameraFocus
02local camera = workspace.CurrentCamera
03camera.CameraType = Enum.CameraType.Scriptable
04camera.CameraSubject = target
05local angle = 180
06local i = 0
07 
08while wait() do
09    camera.CoordinateFrame = CFrame.new(target.Position)
10    * CFrame.Angles(0, angle, 0)
11    * CFrame.new(0, 0, 0)      
12    angle = angle + math.rad(1)
13    i = i + 1
14    if i > 3155692631556926 then break end
15 
16end

remember disabling a script is the property of a script, here is my logic.

Script runs or stops, script is disabled/enable by another script, the camera properties are changed by that script. If this didn't help then I would suggest adding more information into how your disabling/resetting.

Ad

Answer this question