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

Camera right click not working after scriptable camera?

Asked by 5 years ago
Edited 5 years ago

So I ran into this error while releasing a huge update for my game, this really ticked me off because people have been waiting for this update.

While I was testing a camera transition I exited it and then my right click wouldn't work!

What happened was that I enter an area which lerped my camera into the position of a cam part. After that, it changed the camera to Scriptable until it teleported me and then it changed back to Custom. When that ended I couldn't use my right click.

I look through about 10 internet pages but none worked. Please help me quickly and with the most helpful answer I can get!

Here is the real question if you didn't get it:

"After entering Scriptable camera type and then going back to Custom, my right click would not work. What is happening?"

Edit:

Here is the script(Please ignore variables you can't find, I showed all important variable sources and creation sources):

local camValue = math.random(1, 6)
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.PlaySign.SurfaceGui.Enabled = false
game:GetService("StarterGui"):SetCore("ResetButtonCallback", false) 

for i = 1, 50 do
    --game.Players.LocalPlayer.PlayerGui.Soundtrack.Game.Volume =                                                        
    game.Players.LocalPlayer.PlayerGui.Soundtrack.Game.Volume - .01
    if camValue == 1 then
        workspace.CurrentCamera.CFrame =            workspace.CurrentCamera.CFrame:lerp(workspace._camUno.CFrame, 0.1)
    elseif camValue == 2 then
        workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace._camDos.CFrame, 0.1)
    elseif camValue == 3 then
        workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace._camTres.CFrame, 0.1)
    elseif camValue == 4 then
        workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace._camUno.CFrame, 0.1)
    elseif camValue == 5 then
        workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace._camDos.CFrame, 0.1)
    elseif camValue == 6 then
        workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace._camTres.CFrame, 0.1)
    end

    if workspace.CurrentCamera.CameraType ~= Enum.CameraType.Scriptable or workspace.CurrentCamera.CameraSubject ~= game.Players.LocalPlayer.Character.Humanoid or script.Parent.Spectate.Value == true then
        workspace.CurrentCamera.CameraType = Enum.CameraType.Custom             
        break
    end
    game:GetService("RunService").RenderStepped:wait()
end
0
See the recent Player Scripts update that's changed some camera scripts like this. You can see it on the devforums. If not, show us your code. xPolarium 1388 — 5y
0
Thanks BabyDevil285 9 — 5y
0
These are the scripts. Please help me out BabyDevil285 9 — 5y
0
A good way to reset the camera would be to set the original camera properties to an array/table at the start. That'll easily undo whatever you were doing with the camera. exxtremestuffs 380 — 5y

Answer this question