Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsQuery.CastResult

Cast result when performing ray-cast or shape-cast queries against geometry.
Read time 1 minuteLast updated 10 days ago

Definition

public readonly struct PhysicsQuery.CastResult

Properties

Property

Description

fractionThe fraction of the input translation at collision in the range (0 to 1).
hitReturns if the cast hit i.e. if the output is valid or not.
iterationsThe number of iterations used in the calculation.
normalThe surface normal at the point of contact. In all non-overlapped cases, this will be a unit-normal. If there was an initial overlap, the normal will be zero (degenerate) along with the PhysicsQuery.CastResult.fraction being zero.
pointThe point of contact.

Operators

Operator

Description

boolImplicitly convert the cast output to a bool using the value in the PhysicsQuery.CastResult.hit flag.