How would I only run a .RenderStepped when the player is not rotating their camera with their right mouse button?
I know this is not a request-site, but I have no idea how I would do this.
I currently have a lot of code inside a .RenderStepped function, but I have noticed that when I rotate my camera with my right mouse button, there is a MASSIVE amount of lag. I want to fix this, but I have no idea how.
I am thinking something like this would work
game:GetService("RunService").RenderStepped:Connect(function()
-- Check if the player is rorating their camera with the right mouse button
-- Do stuff
end)
Any help is greatly appreciated!

2 comments
What I mean is that the code inside the .RenderStepped function will only run if I am NOT currently rotating my camera with the right mouse button.
So that is why i put the "else" So that you can paste your code there