Camera Angle When Holding Tool

Hi! I am making a game and I was wondering how to make a the camera lock to the right and behind your body when holding a gun, similar to Jailbreak. Thanks in advance!

I believe you would use RenderStepped and calculate a CFrame that equals to behind the character at the right of his body. Don’t forget to set the camera to Scriptable before doing that.

1 Like

I haven’t made many games so I don’t know how to do that. Can you explain please?

You should probably use :BindToRenderStep instead of .RenderStepped.

An example of how you’d lock a player’s camera behind their character.

local runService = game:GetService('RunService')
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
local character = player.Character or player.CharacterAdded:Wait()

local function adjustCamera()
    camera.CFrame = CFrame.new(character.Torso.CFrame * CFrame.new(0, 0, 5)
end

runService:BindToRenderStep('CameraBehindPlayer', 201, adjustCamera)
1 Like

Isn’t this just shift lock??
30

But this permanently locks the camera behind them, right? How do I make this only happen when they hold out a gun?

Just put it under

Tool.Equipped

1 Like