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!
Remember to use Button2Down for right click
local mouse = game:GetService("Players").LocalPlayer:GetMouse() game:GetService("RunService").RenderStepped:Connect(function() if mouse.Button2Down then -- Do nothing else -- your script end end)
Try this