Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


RaySnap(Ray)

Casts ray against the Scene and reports whether an object lies in its path.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public static object RaySnap(Ray ray)

Parameters

ray

Returns

Type

Description

ObjectA boxed RaycastHit, null if nothing hit it.

Remarks

The
ray
only returns intersections with GameObjects that have a collider component attached to them.