Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with Camera moving up in Y-axis when a gun is fired?

So I have function below that is called in a function named 'shoot()' and the shoot function works but this recoil function does not work. What I am trying to do is, when the gun is shot, the camera will go up a little. Please help, there are no errors.

function recoil()
	cam.CFrame = cam.CFrame + Vector3.new(0,1,0)
end

2 comments

0

This is probably because the camera type is not set to scriptable.

0

Use rotation or FieldOfView(FOV) rather than literally moving the camera up. You might find that your current method will become undesirable. Source: Personal experience. Making an FPS framework now.

1 answer

im not sure it will work because i write in the browser but try this!

function recoil()
	cam.CameraType = "Scriptable"
	cam.CFrame = cam.CFrame + Vector3.new(0,1,0)
	cam.CameraType = "Custom" --or whatever type you want
end

This discussion is preserved as it was. New answers, comments, and votes are closed.