#Manipulating camera

3 messages · Page 1 of 1 (latest)

mild plover
#

so how would i make a script where you have a over the shoulder camera (a tps with a offset) and when you press t you switch shoulder. (like tlou and ots gun system) pls help

#

heres the code:

#

game.Workspace.CurrentCamera.CameraType = "Scripted"

local plr = game:GetService("Players").LocalPlayer
local UIS = game:GetService("UserInputService")

local debounce = false
local toggled = true

plr.CharacterAdded:Connect(function(char)
if debounce == false then
if toggled == true then
debounce = true
char:WaitForChild("Humanoid").CameraOffset = Vector3.new(1.5,1.5,6)
wait(1)
debounce = false
toggled = false
elseif toggled == false then
debounce = true

UIS.InputBegan:Connect(function(input, gp)
    
    if input.KeyCode == Enum.KeyCode.T then
        
                char:WaitForChild("Humanoid").CameraOffset = Vector3.new(-1.5,1.5,-6)
                wait(1)
                debounce = false
                toggled = false
                
            end
    end)

end
end
end)