Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


QueryParameters

Creates a struct to set up parameters for batch queries: RaycastCommand, BoxcastCommand, CapsulecastCommand, SpherecastCommand.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Struct
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public struct QueryParameters

Remarks

Use this struct to configure hit flags and layer mask. This supports hit triggers, hit backfaces and hit multiple Mesh faces.
Note: Only RaycastCommand supports hitting multiple Mesh faces.

Fields

Value

Description

hitBackfacesWhether physics queries should hit back-face triangles.
hitMultipleFacesWhether raycast batch query should hit multiple faces.
hitTriggersWhether queries hit Triggers by default.
layerMaskA LayerMask that is used to selectively filter which colliders are considered when casting a ray.

Constructors

Static Properties

Property

Description

DefaultCreate a default QueryParameters struct.