-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[4.0] StaticBody3D not detected into an Area #57539
Comments
This difference is likely to be the BVH code which is mostly responsible for area / static collisions, and is shared between 3.x and 4.0. The 4.0 version has intentionally got temporarily behind bug fixes in the 3.x version as we made some large changes / bug fixes and wanted to make sure these worked, but I will be porting this back to 4.0 very soon (this is mostly just a straight copy of files). There's also a related longstanding bug with areas and statics (that pre-dates the BVH) that I will hopefully be fixing soon, but it doesn't seem to be the one in this issue. |
I've just tried this with #57630 and it doesn't show the message even with the updated BVH. I'll try and have a debug but I'm not sure of what other changes there may be between the two version in the physics. Ok I've debugged this, with a special build that corrects for the area / static bug and allows this (just in case that was the problem). The BVH is sending the pairing callback correctly, but the physics is not acting on it to send a signal for some reason. So I think this would need a physics guys to debug. |
In the minimal reproduction project, the |
The current design of (the code of) Godot Physics is that unmoved areas do not collide with static bodies. In the minimal reproduction project, the internal In 3.x with Godot Physics the behavior is the same; no collision is detected after the first frame (though the To address this issue either the design of Godot Physics should be changed (to somehow consider more areas for collision, with the restriction that it should still be efficient), or this caveat should be added to the documentation of every relevant method and signal. |
Ah 😀 The object you are moving is a The current behaviour therefore makes total sense, and it maybe does do a collision detection on the first entry into the world. The fact it works in bullet is likely because bullet has no distinction between static and dynamic objects (in a sense it works by accident, but it is not intended). Yes even the documentation seems to mention this that it should not move. Maybe we need to make it clearer that if it does move, it is not intended to detect collision: So yes am in agreement with @rburing but assuming this is correct I think it just needs the docs making clearer, I don't think it should be changed. If you want to move something like this but not have it controlled by physics, then it would seem that by definition it should be a kinematic body rather than static, afaik. |
I've marked this as a good first issue : modifying the docs to make clear that statics are intended to be non-moving, and are not guaranteed to detect collisions when moved. |
Yes, I actually would like to do just that. Do I have to be assigned or can I just make a pull request? |
No need to be assigned, just make a PR. 👍 If it was a large PR sometimes it is worth making a note that you are working on it so multiple people don't duplicate work at the same time, but for small ones like this there is usually no need. |
Hey excuse my ignorance but would you have an idea as to where in the documentation the description of staticbody3d is, because I cant seem to find it. |
The file you need to modify is See Contributing to the class reference for more information. |
thanks will work on it |
done |
@kevinloustau as I did comment in #58710 (comment), in godot 4.0, you need to use the AnimatableBody instead of the StaticBody when your intention is to move the object. |
This is a bug, not a documentation issue. The behavior is different from Godot 3 (default engine, Bullet). I have static bodies that do not move. I have areas attached to kinematic bodies, and the areas do not detect when the static bodies enter them. It worked fine in Godot 3. Imagine a switch on a wall, and the player detects it has an interactable object in front of it. Currently only my kinematic bodies are detected. All of my pickup items (weapons, shields, potions) and interactable nodes are broken. This issue isn't about StaticBody and whether it moves or not, it's about Area3D. The whole purpose of Area3Ds is to detect physics bodies without calculating collision. Area detection should work with all physics bodies if the Area is monitoring, the collisionshape is enabled, and the collision layer and layer mask line up. Area3D Manual page - Nothing about static/kinematic/etc as that is irrelevant.
This issue should be renamed to "Area3D doesn't detect StaticBody3D". Edit: It appears this issue is a duplicate, as the original is still open from 4 years ago. #17238. The Area has to be marked both Monitoring and Monitorable, which is contrary to the documentation. Then the Area3D will send signals when static bodies enter it. |
Godot version
v4.0.alpha.custom_build [2aee84c]
System information
Windows 11
Issue description
Moving a StaticBody3D into an Area. I can't detect the body into the Area
It is working correctly using 3.4.2, but not on master at this date.
Steps to reproduce
Minimal reproduction project
StaticBody and Area 4.0.zip
StaticBody and Area 3.4.2.zip
The text was updated successfully, but these errors were encountered: