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

How do I fix players camera without it behaving weird?

Asked by 8 years ago

So, I am using Camera Manipulation. I looked this up and their is a great post on the wiki. I used the code they provides for the "Rotating Camera" and the "Fixing the Camera".

They are both in Local Scripts and are done exactly as it says. It works perfect. I have it set when a user clicks a TextButton, their camera will be fixed. The only problem is, once it is changed back, the camera is really shaky and doesn't behave right.

Anyone know what's wrong?

Wiki Article on this: http://wiki.roblox.com/index.php?title=Camera_manipulation

Change Camera:

-- Change camera
function onClicked()
    game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
    camera.CameraType = Enum.CameraType.Scriptable
    camera.CameraSubject = target

    while wait() do
    camera.CoordinateFrame = CFrame.new(target.Position) 
            end
        end
    end
end

script.Parent.MouseButton1Click:connect(onClicked)

Fix Camera

function onClicked()

game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"

script.Parent.MouseButton1Click:connect(onClicked)
0
We need more information, could you include some code? darkelementallord 686 — 8y
0
Updated. When I straight copied it over, it didn't work. In the Change Camera I tried removing some of the code I didn't want/need, and it didn't fix it. SirBrayden 35 — 8y
0
Do you ever break the while loop in the first script before fixing the camera? That might be your problem. Pyrondon 2089 — 8y
0
Nothing I see is in the way or "breaking" the loop. SirBrayden 35 — 8y

Answer this question