Rotate sprite

How to rotate a sprite correctly?

local pos = self.Owner:GetShootPos()
local ang = self.Owner:GetAimVector()
pos = pos+(ang*128)

local m = Matrix()
m:SetAngles(Angle(0, 90, 0))
m:SetTranslation(Vector(0, 0, 0))
render.SetMaterial(Material( “sprites/blueglow2” ))
render.DrawSprite(pos, 20, 20, Color(255,255,255))

This moves it somewhere random.

You don’t really rotate a sprite. If you really must do it, either edit the texture, or try looking into .vmt parameters.