Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cridenour opened this issue Sep 26, 2022 · 7 comments

Comments

@cridenour
Copy link
Contributor

cridenour commented Sep 26, 2022


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 collision_mask. 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:
3. 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
Copy link

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

@jsardev
Copy link

jsardev commented May 2, 2023

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

@RawEnchilada
Copy link

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

@Razboinicul
Copy link

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

@Denatle
Copy link

Denatle commented Jan 7, 2024

Same with Area2d, 4.2.stable, windows 11

@QSSE2016
Copy link

QSSE2016 commented Oct 18, 2024

Hey everyone, also running into this issue in Godot 4.3 stable. Found a rather strange solution to it.
i was setting collisions through script (via collision_layer = ...).

Before (not working):
`func _ready() -> void:

$".".collision_layer = 3 + int(element)`

After (working)
`func _ready() -> void:

var body: StaticBody2D = $"."

body.set_collision_layer_value(3 + int(element),true)`

I have no idea why it wasnt working before. Is Layer 1 really important to the engine or something? cause with the After code you still keep that layer 1 default true value. Not really sure, but hope this helps.

@LO-0116
Copy link

LO-0116 commented Dec 10, 2024

bug persists in v4.3.stable.official [77dcf97], windows 11.

Perhaps note-worthy: collision between instantiate StaticBody2Ds are broken, but not broken between Area2Ds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants