I’m making a game and in the picture you see a block that should be attached to the camera, but the problem is that this script affects the fps. Here’s my script:
local part = workspace.Part
game:GetService("RunService").Stepped:Connect(function()
part.CFrame = game.Workspace.CurrentCamera.CFrame
end)
Make sure your part is anchored. Unanchored parts handled this way will cause a lot of lag.
Also you’re using the wrong thing to hook into. You want to explicitly call this function before the camera updates (otherwise you’ll see the part stuttering when you have full frame rate). This new method here allows you to specify the priority:
Just a heads up, if you CFrame your part to the Camera’s exact CFrame, you wont see the part at all since you’re inside of it. Make sure to offset accordingly!
Then something else is causing the lag because I’m not having any problems on my end when using the same code. This could be a result of something else happening in your studio, poor PC performance, or an entirely different factor.
If you make the part invisible does it stop the lag? Also can you defer whether it’s the part itself that’s lagging or if it’s your whole studio session?
You can adjust exposure compensation, or use VOLUMIKA (paid), but no not really. Volumetric lighting is a seriously expensive task. If it was this easy then Roblox would have added it around a decade ago!