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

Making it so i cant move or zoom?

Asked by 4 years ago

Im making a GUI only game, but u can still move around in the game, and zoom in and out. How can I make it so i cant move or zoom at all

0
Look at CameraMaxZoomDistance and CameraMinZoomDistance https://developer.roblox.com/en-us/api-reference/property/Player/CameraMaxZoomDistance ForeverBrown 356 — 4y
0
that does the camera but what about moving around? woahsnake 4 — 4y
0
Are you using the CameraType Enum Scriptable? SerpentineKing 3885 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

change the number 25 to the zoom distance you want

game.StarterPlayer.CameraMaxZoomDistance = 25

this should work, i have used it before

0
make sure to change the camera type to scirptable Cynical_Innovation 595 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

To stop the zoom, I'd set the CameraMaxZoomDistance to be the same number as the CameraMinZoomDistance, this is easily done in the 'StarterPlayer' service. For stopping player movement, I'd just anchor the player's torso (Head is best since r15 has different names and stuff like that), that should do it.

-- for r6
game:GetService("Players").PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        local torso
        repeat
            torso = character:FindFirstChild("Torso")
            wait(0.1)
        until torso ~= nil
        torso.Anchored = true
    end)
end)

-- for r15
game:GetService("Players").PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        local head
        repeat
            torso = character:FindFirstChild("Head")
            wait(0.1)
        until head ~= nil
        head.Anchored = true
    end)
end)

And if you're also wanting to know how to stop the movement of the camera, gimme a comment and I'll try and figure out a solution for ya.

Answer this question