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

CollisionShape2D does not exist at run-time after reparent/duplication #1183

Closed
not-surt opened this issue Jan 11, 2015 · 8 comments
Closed

Comments

@not-surt
Copy link
Contributor

When reparenting a CollisionShape2D to a StaticBody2D or duplicating a CollisionShape2D in a StaticBody2D the new shape will not exist at run-time until it is moved on the editor canvas.

Demo project: https://docs.google.com/uc?export=download&id=0B7Mva4UEh5kxRk5BOFlLazBLekk
Run the demo project.
The StaticBody2D reports as having 0 shapes.
Move a CollisionShape2D on the canvas.
Run the demo project.
The StaticBody2D now correctly reports as having 2 shapes.

@reduz
Copy link
Member

reduz commented Jan 11, 2015

collisionshape2D never exists at runtime because it's a helper for the
editor.
This will change soon though, since it seems there is a lot of use for it
being accessible. Might be enabled with a flag.

On Sun, Jan 11, 2015 at 6:18 AM, surt notifications@github.com wrote:

When reparenting a CollisionShape2D to a StaticBody2D or duplicating a
CollisionShape2D in a StaticBody2D the new shape will not exist at run-time
until it is moved on the editor canvas.

Demo project:
https://docs.google.com/uc?export=download&id=0B7Mva4UEh5kxRk5BOFlLazBLekk
Run the demo project.
The StaticBody2D reports as having 0 shapes.
Move the a CollisionShape2D on the canvas.
Run the demo project.
The StaticBody2D now correctly reports as having 2 shapes.


Reply to this email directly or view it on GitHub
#1183.

@not-surt
Copy link
Contributor Author

Yes but it is supposed to be turned into a Shape2D that does exist at runtime.
That Shape2D will not exist after reparent/duplication until the corresponding CollisionShape2D is moved on the editor canvas.
It seems as though the Shape2D generation is being cached, but that cache isn't being updated correctly.

@godotengine
Copy link
Collaborator

oh the Shape2D is in the CollisionObject2D API during runtime

On Sun, Jan 11, 2015 at 4:18 PM, surt notifications@github.com wrote:

Yes but it is supposed to be turned into a Shape2D that does exist at
runtime.
That Shape2D will not exist after reparent/duplication until the
corresponding CollisionShape2D is moved on the editor canvas.


Reply to this email directly or view it on GitHub
#1183 (comment).

OkamStudio

@not-surt
Copy link
Contributor Author

I just discovered that the reverse is also true.
I had deleted some CollisionShape2Ds from previously duplicated StaticBody2Ds in the editor but the Shape2Ds corresponding to the deleted CollisionShape2Ds were still appearing when the game was run.
It does appear to be some kind of caching issue.
If I move one of the remaining CollisionShape2Ds in the editor it seems to update properly and all deleted Shape2Ds no longer show up at run-time.

@akien-mga
Copy link
Member

I believe this has been fixed in the current master branch.

@leonkrause
Copy link
Contributor

I can still reproduce this issue in master.

@bojidar-bg
Copy link
Contributor

I assume this was fixed in the 3.0 collision shape refactor (currently just 2D)?

@reduz
Copy link
Member

reduz commented Aug 4, 2017

This is finally fixed now, both in 3D and 2D, let's celebrate!!

@reduz reduz closed this as completed Aug 4, 2017
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

5 participants