Laser beam deviation


I am working on a SWEP that features a laser put through a refraction crystal, effectively splitting it into multiple beams and pointing them in different directions.

I’ve been having some trouble figuring out how to deviate the beams away from my crosshair WITHOUT utilizing the player’s GetEyeTrace function.

The reason I am not using this function is it leads to visual oddities when the player looks at something closer / further away.

Example being: If I tell the secondary beams to deviate 50 units away from the center of the screen, the angle of the beams will change depending on how far away I look. Which looks… weird.

What I’m asking is, is there a way to accomplish this

without relying on the players EyeTrace.HitPos?

Also here’s an example of the bug: