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

cameraThe camera to perform the raycast from.
hitThe raycast hit information output.

Returns

boolTrue 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

cameraThe camera to perform the raycast from.
hitThe raycast hit information output.
maxDistanceThe maximum distance the raycast can travel.

Returns

boolTrue 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

cameraThe camera to perform the raycast from.
hitThe raycast hit information output.
maxDistanceThe maximum distance the raycast can travel.
layerMaskThe layer mask to use for the raycast.

Returns

boolTrue 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

controllerThe camera controller to perform the raycast from.
hitThe raycast hit information output.

Returns

boolTrue 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

controllerThe camera controller to perform the raycast from.
hitThe raycast hit information output.
maxDistanceThe maximum distance the raycast can travel.

Returns

boolTrue 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

controllerThe camera controller to perform the raycast from.
hitThe raycast hit information output.
maxDistanceThe maximum distance the raycast can travel.
layerMaskThe layer mask to use for the raycast.

Returns

boolTrue if the raycast hit something, false otherwise.