Recently I needed a freecam script for my level editor that I’m making and all the public resources for freecams just weren’t working and the default freecam script had many issues, so here is a better freecam module that is a modified version of the default freecam script.
Fixed issues that the default freecam script had:
- Higher FPS resulting in slower camera rotations.
- Up and down movements being in local space rather than world space.
- Camera not using the players in settings mouse sensitivity for rotation.
- Controllers not having a keybind for slowing down the camera. (example; shift for keyboards)
- No mobile support.
Module Functions:
StartFreecam()
Calling this function puts the player into freecam.
This function has 2 optional parameters, DisablePush
and DisableEffects
.
- DisablePush: Prevents the internal push function from calling.
- DisableEffects: Option to not display the onscreen effects when entering freecam.
StopFreecam()
Calling this function puts the camera back to normal.
This function has 1 optional parameter, DisablePop
.
- DisablePop: Prevents the internal pop function from calling.
SetFreeCamSpeed()
Sets how fast the camera moves (not rotation).
This function has 1 optional parameter, Speed
.
- Speed: How fast the camera can move, leave blank/nil for the default.
Code Example:
local userInputService = game:GetService("UserInputService")
local freecam = require(game.ReplicatedStorage.Freecam)
local toggled = false
userInputService.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.F or key.KeyCode == Enum.KeyCode.ButtonX then
toggled = not toggled
if toggled then
freecam:StartFreecam(true,false)
else
freecam:StopFreecam(true)
end
end
end)
-- example script comes with the module in its folder.
See the optional screen effect here:
Freecam Warp Effect - Imgur Link
Get the module here:
Freecam v1.1 Module Link - Creator Store Link