TestRaycastTo2D

Inherits: QueryTest2D < Node2D

A query test that casts a ray or shape from the QueryItem2D to a QueryContext2D, to check if it hits.

Description

A query test that casts a ray or shape from the QueryItem2D to a QueryContext2D, to check if it hits.

Properties

bool

cast_from_context

false

int

collision_mask

1

QueryContext2D

context

float

cost

1.42 (overrides QueryTest2D)

Array[NodePath]

exclusions

[]

TestRaycastTo2D.RaycastMode

raycast_mode

0

Shape2D

shape

TestType

test_type

1 (overrides QueryTest2D)

bool

use_shape_cast

false


Property Descriptions

bool cast_from_context = false 🔗

  • void set_cast_from_context(value: bool)

  • bool get_cast_from_context()

On true, invert the casting and start from context into QueryItem2D.


int collision_mask = 1 🔗

  • void set_collision_mask(value: int)

  • int get_collision_mask()

The physics layers this test will detect.


QueryContext2D context 🔗

The target QueryContext2D that will be detected.


Array[NodePath] exclusions = [] 🔗

  • void set_exclusions(value: Array[NodePath])

  • Array[NodePath] get_exclusions()

What collision objects will be excluded from the test. Usually the querier should be excluded.


TestRaycastTo2D.RaycastMode raycast_mode = 0 🔗

  • void set_raycast_mode(value: TestRaycastTo2D.RaycastMode)

  • TestRaycastTo2D.RaycastMode get_raycast_mode()

What type of collision object this test will detect.


Shape2D shape 🔗

  • void set_shape(value: Shape2D)

  • Shape2D get_shape()

There is currently no description for this property. Please help us by contributing one!


bool use_shape_cast = false 🔗

  • void set_use_shape_cast(value: bool)

  • bool get_use_shape_cast()

There is currently no description for this property. Please help us by contributing one!