When player sitting on seat camera can look through all parts

Basically the title, how can I make it so when a player sits on any seat their camera can look through all parts?

Does anyone know how to do this?

Be more specific. What do you mean by look through parts?

By default the players camera cannot look through parts

I assume you are talking about Invisicam.

-- ServerScriptService.SeatCamera
local function character_added(character:Model)
	local player = game.Players:GetPlayerFromCharacter(character)
	local humanoid:Humanoid = character:WaitForChild('Humanoid')
	
	humanoid.Seated:Connect(function(active)
		if active then
			player.DevCameraOcclusionMode = 'Invisicam'
		else
			player.DevCameraOcclusionMode = 'Zoom'
		end
	end)
end

local function player_added(player:Player)
	player.CharacterAdded:Connect(character_added)
end

game.Players.PlayerAdded:Connect(player_added)

This code will detect when a player sits/unsits in a seat and sets the player’s DevCameraOcclusionMode to Invisicam or Zoom.

2 Likes

How can I make it so the camera just goes through the wall without making the wall invisible?

I think this should work.