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
COMMUNITY QUESTION
Making it so i cant move or zoom?
2 answers
change the number 25 to the zoom distance you want
game.StarterPlayer.CameraMaxZoomDistance = 25
this should work, i have used it before
1 comment
0
make sure to change the camera type to scirptable
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Look at CameraMaxZoomDistance and CameraMinZoomDistance https://developer.roblox.com/en-us/api-reference/property/Player/CameraMaxZoomDistance
that does the camera but what about moving around?
Are you using the CameraType Enum Scriptable?