Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

how to control and change the camera angle?

Asked by 3 years ago
Edited 3 years 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 595 — 3y
0
hello, please read the community guidelines before posting. Dan_PanMan 227 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years 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