Impact

An Impact object can be returned when casting a ray. (see Camera.CastRay, Player.CastRay, PointerEvent.CastRay)

Properties

Block touched by the ray. Not nil if the Impact represents a Block.

local impact = Player:CastRay()
print(impact.Block)	-- prints hit block's id

Distance to impact when casting a ray. (see Camera.CastRay, Player.CastRay, PointerEvent.CastRay)

Not nil if the Impact represents a Block.

Indicates what block face has been touched.

Player touched by the ray.

Pointer.Down = function(event)
  local impact = event:CastRay()
  print(impact.Player)
end