Skip to content

HitResult

A HitResult is used by the World Raycast function to give details about where the collision happened (GetPosition) and what the normal vector of the collision is (GetNormal).

Functions

Function Name Usage Description Notes
GetPosition Vector hitResult:GetPosition() Get position of hit in world space
GetRelativePosition Vector hitResult:GetRelativePosition() Get position of hit relative to the Entity hit
GetNormal Vector hitResult:GetNormal() Get normal direction of hit in world space
GetRelativeNormal Vector hitResult:GetRelativeNormal() Get normal direction of the hit relative to the rotation of the Entity hit
GetPartName string hitResult:GetPartName() get the name of the part of the entity that was hit. For example a headshot on a player character will return 'head'

Overrides

Override Name Usage Description Notes
new_index hitResult.var = object value