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

Help wanted: Adding event listener not specified inside the blueprint cause panic #81

Closed
tungtose opened this issue Dec 26, 2023 · 5 comments · Fixed by #82
Closed

Help wanted: Adding event listener not specified inside the blueprint cause panic #81

tungtose opened this issue Dec 26, 2023 · 5 comments · Fixed by #82

Comments

@tungtose
Copy link

Thank you for the effort you put into making this crate!

I am trying to integrate the spawned blueprint with bevy_mode_picking by adding a listener along with the blueprint like the image below. And there's a cause for panic by clone_entity:

image

Here is the panic location (line 40):
image

I also tried register_type all visible relative components from bevy_mod_picking but still panicked. Am I missing something to make this working?

@kaosat-dev
Copy link
Owner

kaosat-dev commented Dec 27, 2023

Hi @tungtose !
Thanks for the kind words and feedback !

  • you are spot on, normally registering all components should have solved the issue
  • right now there is no information about which component failed
  • having to register all types in that use-case is rather annoying to begin with, although I have not found a work around yet

Possible "solution":
I 'll try to upload a new version today where it at least prints out information about what components are missing in the type registry, I think that should be an ok stop-gap solution ?

kaosat-dev added a commit that referenced this issue Dec 27, 2023
…82)

* feat(bevy_gltf_blueprints): improved error handling for clone_entity
 * you will now get component name for components that have not been registered & thus cannot be cloned
* added a small example (in examples/bevy_gltf_blueprints/basic), just press 'U' at runtime to try to spawn an entity with unregistered components
* closes #81
@kaosat-dev
Copy link
Owner

@tungtose , this is now released : bevy_gltf_blueprints v0.5.1, it should give you information about what components could not be cloned because of the lack of registration
Screenshot from 2023-12-27 13-15-57

Perhaps it would make more sense to leave this issue open , or create a specific one, as I consider this only a stop-gap solution, ideally not every component should need to be registered.

@tungtose
Copy link
Author

@kaosat-dev Thank you for quick solution!
After update and rerun, turn out the component that I added is not derive Reflect.

So for now I just import directly from the gltf file generated from your tool as a quick solution.

@kaosat-dev
Copy link
Owner

Hi @tungtose just wanted to let you know, that with the release of version 0.6 you can now add unregistered components when spawning blueprints (as in your original bug report with the On<PointerDown... example :)

@tungtose
Copy link
Author

tungtose commented Jan 12, 2024

@kaosat-dev I just tested and its work as expected, thank you

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