Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

CastResult

struct in UnityEngine.LowLevelPhysics2D

/

Implemented in:UnityEngine.Physics2DModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Cast result when performing ray-cast or shape-cast queries against geometry.

Properties

Property Description
fraction The fraction of the input translation at collision in the range (0 to 1).
hit Returns if the cast hit i.e. if the output is valid or not.
iterations The number of iterations used in the calculation.
normal The 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 CastResult.fraction being zero.
point The point of contact.

Operators

Operator Description
bool Implicitly convert the cast output to a bool using the value in the CastResult.hit flag.