Merge pull request #66076 from Sauermann/fix-double-physics-input-events-for-layers

Fix physics events being interpreted twice for nodes in canvas layer
This commit is contained in:
Rémi Verschelde 2023-02-01 07:29:16 +01:00
commit b7c0f613b5
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@
<members>
<member name="canvas_instance_id" type="int" setter="set_canvas_instance_id" getter="get_canvas_instance_id" default="0">
If different from [code]0[/code], restricts the query to a specific canvas layer specified by its instance ID. See [method Object.get_instance_id].
If [code]0[/code], restricts the query to the Viewport's default canvas layer.
</member>
<member name="collide_with_areas" type="bool" setter="set_collide_with_areas" getter="is_collide_with_areas_enabled" default="false">
If [code]true[/code], the query will take [Area2D]s into account.

View File

@ -83,7 +83,7 @@ int GodotPhysicsDirectSpaceState2D::intersect_point(const PointParameters &p_par
continue;
}
if (p_parameters.canvas_instance_id.is_valid() && col_obj->get_canvas_instance_id() != p_parameters.canvas_instance_id) {
if (col_obj->get_canvas_instance_id() != p_parameters.canvas_instance_id) {
continue;
}