Need help with camera cframe! Moving side to side (degrees)

I’m trying to move the camera side to side like in this video (Only example I found from Criminality):


I can’t figure out how to get this effect, It could also help with making a gun recoil system.
I’ve tried everything but I can only get the camera to move similarly while its in scriptable mode, but I can’t figure out how to get this effect while NOT in scriptable mode.
How can I get this effect (of rotating camera left and right slightly).? I feel like this is not that complex but I can’t find how to do it anywhere :sweat_smile:

1 Like

Use BindToRenderstep to make code happen before the camera overrides the z-axis.

runsService:BindToRenderstep(Enum.RenderPriority.Camera-1, function(delta)
--Code (Camera.CFrame * CFrame.Angles(0,0,mat.rad(delta))
end
2 Likes

It seems to be working, I’ll test it out more tomorrow and update you since I have to go to bed

1 Like

Ok, glad it works, good night!

1 Like

It moves the camera, but I can’t move it without it bugging out (being in place), is there any other way to rotate the z axis or making it move without bugging? because it just stays in place and I cant move the camera around

Can I see the full script please

I fixed it, the problem was that I didn’t use bindtorenderstep but I used heartbeat, that made the script break. Thanks for your help! :slight_smile:

1 Like

no problem, have a nice day


1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.