Hey there, I’m just looking for the best way to offset the camera by a few studs when my bound function is fired but you know… being able to move around with the camera after. Currently how I have my script -
This is my code, if you can provide resources or help me by explaining how I should do this I would be very appreciative.
local function handleAction(actionName, inputState, inputObject)
-- Aiming
if actionName == Action_Aim and Status ~= "Reloading" and Equipped then
-- Input Began
if inputState == Enum.UserInputState.Begin then
Aim_Animation:Play()
Status = "Aiming"
local function CamOffset()
while Cam.CameraType ~= Enum.CameraType.Scriptable do
Cam.CameraType = Enum.CameraType.Scriptable
wait()
end
Cam.CFrame = Cam.CFrame * (CFrame.new(2,0,0) * CFrame.Angles(0,0,0))
end
RunService:BindToRenderStep("TempBinding", 201, CamOffset)
wait()
RunService:UnbindFromRenderStep("TempBinding")
-- Input Ended
elseif inputState == Enum.UserInputState.End then
EndAnimations()
Idle_Animation:Play()
Status = "Idle"
Cam.CFrame = Cam.CFrame * (CFrame.new(-2,0,0) * CFrame.Angles(0,0,0))
end
end
end
(Obviously isn’t my entire script, just the relevant piece)