Skip to content

EntityHitResult

Inherits from: HitResult

Represents the result of a raycast that intersects with an entity, providing details about the entity hit.

Example: Name the entity you look at

local hit = spell.owner:raycastEntity(16)
if hit then
  print("You look at " .. hit.entity.name)
end

Fields

entity: Entity — Read-Only

A reference to the entity that was hit by the raycast.