PlaceObject(Vector2, out Vector3, out Vector3)
Casts a ray against the loaded scenes and returns the nearest intersected point on a collider.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor
PlaceObject(Vector2, Vector3, Vector3)
public static bool PlaceObject(Vector2 guiPosition, out Vector3 position, out Vector3 normal)
Parameters
Returns the nearest intersected point to a ray cast from the mouse position into the scene.
Returns the normal of the nearest intersected point to a ray cast from the mouse position into the scene.
Returns
Type | Description |
|---|---|
| bool | Returns true if the raycast intersected something in the scene; otherwise, false. |
Remarks
Use this method to match the behavior of drag and drop in the SceneView.
HandleUtility.PlaceObject also queries any delegates registered to HandleUtility.placeObjectCustomPasses when determining the nearest point.