Get Wall hit of eye trace?

Can anybody explain me how to get a the hit position of an eye trace when it hits the world? I tried to find some stuff myself but didnt find anything.

You check if HitWorld and then get HitPos

I tried that but it just returned the same postion all the time for some reason.

function SWEP:PrimaryAttack()
	local trace = util.TraceLine( {
	start = EyePos(),
	endpos = EyePos() + EyeAngles():Forward() * 10000,
	filter = function(ent) if (ent:GetClass() == "world") then return true end end
	} )

If this is inside a SWEP, I’d recommend using ply:GetShootPos instead of EyePos() and ply:EyeAngles() instead of EyeAngles() to avoid interference from cameras or other view entities. Additionally, I don’t think your filter is working properly; consider using instead.

FWIW the toolgun uses util.GetPlayerTrace for the trace. It’s probably best to use that and just check if it HitWorld.