trace
Ray tracing
Properties
fraction
normal
surfaceFlags
contents
allSolid
startSolid
walkable
Methods
getHitLocation(start, end)
getHitLocation(start, end)
Returns the hit position of the trace.
Example:
local pointA = Vec3:new(0, 0, 0)
local pointB = Vec3:new(0, 0, 1000)
local trace = engine.trace(pointA, pointB)
local hitPosition = trace.getHitLocation()
if (trace.fraction < 1) then
print("Hit something at: " .. hitPosition:toString())
end
Last updated