Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to let players see through walls?

Hey guys, I am trying to let players be able to zoom out and be able to zoom through walls in my game. I remember the tracking camera being able to let players do this, so i've made a script that I thought would work, but it sadly does not let players be able to do this.

Script:

while true do
	wait()
	local c = workspace:GetChildren()
	for i=1, #c do
		if c[i].className == "Camera" then
			c[i].CameraType = "Track"
		end
	end
end

Help is appreciated!

1 answer

✓ Accepted answer

In order to properly call a player's camera use the CurrentCamera of the Workspace in a LocalScript

In addition, the CameraType is an Enum, not a string.

REVISED Local Script

repeat wait() until game:GetService("Players").LocalPlayer.Character.Parent == workspace
local c = workspace.CurrentCamera
c.CameraType = Enum.CameraType.Track

The repeat-loop is needed since if the player's character is not in the workspace, the cameratype will not change.

2 comments

0

use CharacterAdded:Wait()

0

What about Transparency? Duh?

This discussion is preserved as it was. New answers, comments, and votes are closed.