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

How does Camera Manipulation work?

So in my game, I need to use Camera Manipulation. The only problem is that I'm new to Camera Manipulation and my script doesn't seem to be working right. This is my script:

local Camera = game.Workspace.CurrentCamera
local Mouse = game.Players.LocalPlayer:GetMouse()
local Players = game:GetService('Players')
InInventory = false





Mouse.KeyDown:Connect(function(key)
	
	if key:lower() == "e" or key:upper() == "E" then
		
		if InInventory == false then
			
			Camera.CameraType = Enum.CameraType.Scriptable
			
			InInventory = true
			
		end
		
	end
	
end)


Mouse.KeyDown:Connect(function(key)
	
	if key:lower() == "e" or key:upper() == "E" then
			
		if InInventory == true then
			
			Camera.CameraType = Enum.CameraType.Fixed
			
			Camera.CameraSubject = Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
			
			wait(2.5)
			
			InInventory = false
			
		end
		
	end
	
end)



I made an inventory system. I want to use Camera Manipulation to make the player not able to move the Camera while in the inventory.

Anyone know how to do this, if so, please help.

2 comments

0

Where is this script located?

0

StarterGui

1 answer

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