-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Collision shapes persist after they've been deleted #7693
Comments
I think the scene is not being updated on the main scene if you run it just after deleting the node, if you touch anything on the main scene so it gets marked as modified before running, it should update the instance with the current version. |
Doesn't seem to be the case in my project, unfortunately, as far as I can tell - I've modified quite a few things in the main scene over the last while and haven't had any of the removed collision shapes stop doing their thing. As an added note, not sure if it's causing the issue, but when I looked into one of the afflicted sub-scene files in a text editor, I noticed that it still has a reference to the deleted capsule - "[sub_resource type="CapsuleShape" id=1]" - Is it possible that the CollisionShape object is being destroyed, but somehow the associated shape itself is somehow staying behind and causing trouble? |
Is possible that, for some reason, the collision shape node was removed and the shape resoure remained there. I was unable o replicate, at least on Windows, I see the CollisionShape2D (after deleting the original) on the editor but does not appears (nor the shape) on the running scene. |
Duplicate of #2804. |
@bojidar-bg I don't think is duplicate because if I understand right, is removing the shape from the editor, not the common error of removing shape from code. |
@eon-s Yeah, but the cause is still the same, even if the symptom is different. You don't get to go to your doctor for coughing and running nose separately, you go for both at once. Anyway, thinking about it, I guess I might reopen this one, since it should be easy to fix this symptom in core. |
@xyroclast
@bojidar-bg I thought it could be some problem with resources on the scene file in 2.1.2 but can't break my scenes here, not even in my most messy projects, might be something else. |
I've also encountered this problem. On Windows 7 and Ubuntu 16.04, both 64 bits versions. Godot 2.1.2 and before. |
For some reason, I was trying to do this on 2D, maybe got confused reading something else, that is why example projects are more than welcome I guess 😅 And yes, removing the CollisionShape for any kind of body does not remove the shape resource, even on Godot 3, custom build of 01/30 from fixnum.org site. |
Its a design problem of godot 2.x which can't be fixed. 3.0 will solve it
…On Feb 1, 2017 11:58 AM, "eon-s" ***@***.***> wrote:
For some reason, I was trying to do this on 2D, maybe got confused reading
something else, that is why example projects are more than welcome I guess
😅
------------------------------
And yes, removing the CollisionShape for any kind of body does not remove
the shape resource, even on Godot 3, custom build of 01/30 from fixnum.org
site.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7693 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z23aPnHL6MvXsxYNJepb-4NV2EwRRks5rYJ2SgaJpZM4LzZ69>
.
|
To avoid this problem while we wait for Godot 3, before removing a CollisionShape, clear the Shape from the inspector, that should remove it from the scene file. |
Thanks for the responses guys, I'll go with @eon-s 's fix until 3 comes out! |
@xyroclast Adding a new collision shape, setting shape then clearing it may solve the inconsistency on the scene file. Or, to make it by hand or if you have more shapes on the body, with the scene closed on Godot, open the tscn file with a text editor, on the section where the body data is located there should appear a couple of "shapes" references (type and properties), check the id and remove the resource with that id on the top of the file, then delete all these lines on the body part (if there are many shapes I'm not sure if you have to fix the index there), finally put the shape count on zero (or the corresponding number) for the body. |
@eon-s thank you! |
Update for anyone else needing a fix: |
I'm revisiting old issues, I think this should be fixed in 3.0, please let us know if that's not the case! |
OS: Linux Mint 18
Godot: 2.1.2
Steps to reproduce:
Create a scene consisting of a KinematicBody with a child CollisionShape (I used capsule). Add some sort of image or animation as well, so the object is visible (I used AnimatedSprite3D). Script the KinematicBody so that it has downward movement (I used the move() function with a downward Y direction)
Save the scene and place an instance of the scene in a scene with a collide-able floor.
Test the game and verify that the object stops at the floor.
Then, delete the CollisionShape from the saved scene.
When you run the test again, you should see the object still continuing to collide with the ground.
Originally I thought this was just my lack of understanding of how Godot collision works, but you can verify that it's a bug by following the above steps again, but never create the CollisionShape in the first place. The object will pass through the floor as expected.
The text was updated successfully, but these errors were encountered: