Is there a way I can disable freecam?

Hello! I’m working on a piano game which requires you to hit shift+p to hit one of the keys. I’m looking for a way to disable freecam or atleast change the keybinds. I can’t seem to find anything yet. Thanks in advance,

2 Likes

Found a script to disable it. Help no longer needed.

2 Likes

Keep in mind free cam is only for developers and normal players can’t use it.

2 Likes

Yea I know, but the point of the game was mainly for me to play it. It’s a concert type game.

3 Likes

This isn’t the case, all players can use FreeCam, unless it has been disabled. @Dope_RBX would you mind sharing the script for others to see it?

3 Likes

I know this post was from a long time ago, but I still haven’t found any reliable script to disable free cam or remove it. There was one on a reddit post, but it didn’t help. I have a piano in my game that I like playing and pressing Shift and P is really bothersome, especially when a lot of songs use it. Do you mind sharing the script here?

Edit: fixed it
game.Players.LocalPlayer.PlayerGui:FindFirstChild(“Free cam”):Destroy()

3 Likes

The Freecam GUI is only created in the PlayerGUI if you have edit access in the game. The GUI will not be created for normal players and cannot be used by them, so, it actually is the case, free cam can’t be used by non developers of the game.

@HyperlyBola
This LocalScript I wrote will reliably get rid of the default Freecam GUI and won’t leak any threads. The script you put doesn’t actually delete the freecam (its named Freecam not Free cam), and it will error if it doesn’t exist when the script runs (aka all of the time because there will never be a Free cam child). Destroy is not a function on nil and FindFirstChild will return nil if it doesn’t exist yet.

local Players = game:GetService("Players")

-- A timeout for how long to wait for a freecam GUI before assuming there is none
local timeout = 10

-- Get the local player and wait for their PlayerGui
local localPlayer = Players.LocalPlayer
local PlayerGui = localPlayer:WaitForChild("PlayerGui")

-- If there is no character we want to wait for one
--  (This would allow you to freecam before your player spawns if you are a developer)
if not localPlayer.Character then
	localPlayer.CharacterAdded:Wait()
end

-- Wait for Freecam GUI with a timeout
local freecamGui = PlayerGui:WaitForChild("Freecam", timeout)
if freecamGui then -- If there was a freecam GUI
	-- Look for the freecam script within it
	local freecamScript = freecamGui:FindFirstChild("FreecamScript")
	if freecamScript then
		-- Disable it (Should stop any running code and disconnect events)
		freecamScript.Disabled = true
	end
	
	freecamGui:Destroy() -- Delete the GUI
end
4 Likes

For some reason using “Free cam” worked earlier, but then I checked the actual name and it was called “Freecam” so idk if the game just didn’t update. I also realized I should’ve used WaitForChild instead of FindFirstChild first. Thanks for the script though, everything works.

3 Likes