Currently working on a custom HUD where I want to make a “fake” 3D HUD where the health and ammo bar jiggle about as you look around. The subtle movement part works fine but all the HUD assets like to slowly drift up and to the left until they reach 0,0 on my screen.
local posx = ScrW() / 18.824 -- OCD will be the death of me local posy = ScrH() / 1.06 hook.Add("HUDPaint" , "HealthHud" , function() // make HUD jiggle a bit local CurAng = EyeAngles() local clampX,clampY = 10 , 10 posx = math.Approach(posx,math.Clamp(CurAng.x, -clampX, clampX), FrameTime()*65) posy = math.Approach(posy,math.Clamp(CurAng.y, -clampY, clampY), FrameTime()*65)
originally I tried to use math.Clamp on posx and posy in math.Approach and this just locked all of my HUD assets to 0,0 completely ignoring the original posx and posy.
I’m just getting into Lua so I apologize if problems like this are tedious and stupid, any bit of help would be appreciated.