Function to find out texture of a surface?

Hey, is it possible in lua to find out what texture is on the surface that a tracer hits?

If that’s so I’d take the job of making a small database of average color for every source texture, and then make it into a wire compatible color finder rangerlike device :smiley:

local function runit(ply)
traceent = ply:GetEyeTraceNoCursor().Entity
material or the actual vtf used by the mdl or w/e

Ok thanks. Though this does not work for ground, when entity is world.

thats actually going to return nil unless somone applied a mat with the mat tool…

sv_cheats 1
impulse 107 - report whether the player is looking at a model, a displacement, or a brush; if a brush, give the texture

Look at the Stranded code, it’s in there somewhere.

No, it isn’t. Stranded uses MatType from a normal trace.