Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsQuery.CastResult

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

Definition

  • Type: Struct
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public readonly struct PhysicsQuery.CastResult

Properties

Property

Description

fractionThe fraction of the input translation at collision in the range (0 to 1).
isValidCheck if the result is valid.
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 _fraction being zero.
pointThe point of contact.

Operators

Operator

Description

boolImplicitly convert the cast output to a bool using the value in the _isValid flag.

Structs

Struct

Description

PhysicsQuery.CastResult.SortAscendingOrderAscending distance sort comparer.