godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.15k stars 20.21k forks source link

Area3D does not see newly instanced StaticBody3D with Monitoring/Monitorable enabled #66468

Open cridenour opened 1 year ago

cridenour commented 1 year ago

Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.


Godot version

4.0.beta1

System information

Windows 10

Issue description

I'm aware of #17238 (specific to Monitorable being enabled, which doesn't help here) and #57539 which is specific to moving a StaticBody. Could be the same fix works for this and #57539 but I did not want to miss this use-case.

When you have a Area3D and a new StaticBody3D is placed in the scene, it will not detect it _until you change the collision_layer or collisionmask. I imagine other "touches" will force an update as well.

Steps to reproduce

  1. Create a scene with an Area3D.
  2. After scene is ready, add a StaticBody3D with the layer of the Area3D's mask.

Optional workaround:

  1. After more time, update the collision_layer or collision_mask.

Minimal reproduction project

Area3D StaticBody.zip

This MRP automates showing the bug and the current workaround.

Brandtweary commented 1 year ago

I'm having this exact same bug in 2D. I'm using Godot version 4.0.beta4, on Windows 11.

jsardev commented 1 year ago

Same issue with Area2D and StaticBody2D, Godot 4.0.2.stable, MacOS.

RawEnchilada commented 1 year ago

Area2D doesn't emit mouse_entered event as well if instantiated from script. Linux v4.0.3.stable.mono.official

Razboinicul commented 1 year ago

Same issue with v4.1.1.stable.official [bd6af8e0e], Linux

Denatle commented 8 months ago

Same with Area2d, 4.2.stable, windows 11