Raycasting.Raycast
Extension Method in Raycasting
Declaration
public static bool Raycast(this Camera camera, out RaycastHit hit)Description
Performs a raycast from the camera.
Parameters
| camera | The camera to perform the raycast from. |
| hit | The raycast hit information output. |
Returns
| bool | True if the raycast hit something, false otherwise. |
Overload
Declaration
public static bool Raycast(this Camera camera, out RaycastHit hit, float maxDistance)Description
Performs a raycast from the camera.
Parameters
| camera | The camera to perform the raycast from. |
| hit | The raycast hit information output. |
| maxDistance | The maximum distance the raycast can travel. |
Returns
| bool | True if the raycast hit something, false otherwise. |
Overload
Declaration
public static bool Raycast(this Camera camera, out RaycastHit hit, float maxDistance, int layerMask)Description
Performs a raycast from the camera.
Parameters
| camera | The camera to perform the raycast from. |
| hit | The raycast hit information output. |
| maxDistance | The maximum distance the raycast can travel. |
| layerMask | The layer mask to use for the raycast. |
Returns
| bool | True if the raycast hit something, false otherwise. |
Overload
Declaration
public static bool Raycast(this CameraController controller, out RaycastHit hit)Description
Performs a raycast from the camera.
Parameters
| controller | The camera controller to perform the raycast from. |
| hit | The raycast hit information output. |
Returns
| bool | True if the raycast hit something, false otherwise. |
Overload
Declaration
public static bool Raycast(this CameraController controller, out RaycastHit hit, float maxDistance)Description
Performs a raycast from the camera.
Parameters
| controller | The camera controller to perform the raycast from. |
| hit | The raycast hit information output. |
| maxDistance | The maximum distance the raycast can travel. |
Returns
| bool | True if the raycast hit something, false otherwise. |
Overload
Declaration
public static bool Raycast(this CameraController controller, out RaycastHit hit, float maxDistance, int layerMask)Description
Performs a raycast from the camera.
Parameters
| controller | The camera controller to perform the raycast from. |
| hit | The raycast hit information output. |
| maxDistance | The maximum distance the raycast can travel. |
| layerMask | The layer mask to use for the raycast. |
Returns
| bool | True if the raycast hit something, false otherwise. |