Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
2

how to control and change the camera angle?

Asked by 3 months ago
Edited 3 months ago

so i am making a gun it is completly done other that one thing... recoil how do i change the camera angle? to be clear i am not asking for how to make the gun have recoil when i shoot just asking for changing the camera angle ok i got the script:

local camera = game.Workspace.CurrentCamera
wait(3)
local debounce = true
local i = 0.1
while i > 0.001 do
    if debounce then
        debounce = false
        camera.CFrame = camera.CFrame * CFrame.Angles(i,0,0)
        i = i/1.2
        wait(0.005)
        debounce = true
    end
    wait()
end
i = 0.005
while i < 0.0285 do
    if debounce then
        debounce = false
        camera.CFrame = camera.CFrame * CFrame.Angles(-i,0,0)
        i = i*1.04
        wait()
        debounce = true
    end
    wait()
end

mine isn't perfect could i see yours to compare 14zander?

0
If you have attempted to make a recoil function, I have one myself, but I'll only give my function if you have attempted it yourself. Cynical_Innovation 577 — 3mo
0
hello, please read the community guidelines before posting. Dan_PanMan 226 — 3mo

1 answer

Log in to vote
1
Answered by 3 months ago
Edited 3 months ago

don't know exactly what angle you want the camera to change to but there are a lot of explanations on camera manipulation here:

https://developer.roblox.com/en-us/articles/Camera-manipulation

there are a few more here too: https://developer.roblox.com/en-us/search#stq=camera

Ad

Answer this question