I’m making a movement system, and i want to detect the change in velocity and use that to change the FOV, but it flickers ALOT when just going straight. what am i doing wrong and how can i fix it / make it less noticeable?
video of what the flickering looks like:
code:
function Renderfunc(Delta) -- run for visual stuff
totvel = math.abs(Char.AssemblyLinearVelocity.X) + math.abs(Char.AssemblyLinearVelocity.Z)
cam.FieldOfView = 75 + (((totvel - prevtotvel))*5) -- *5 added to make the flickering more noticeable in the video
prevtotvel = totvel
-- some code removed, none that effect this
end
I’m pretty confused what might be causing this, and tried using delta to fix it but with no avail ;p