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

scene.rs example crashes #3986

Closed
gabriel-gheorghe opened this issue Feb 18, 2022 · 8 comments
Closed

scene.rs example crashes #3986

gabriel-gheorghe opened this issue Feb 18, 2022 · 8 comments
Labels
A-Scenes Serialized ECS data stored on the disk C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy P-Crash A sudden unexpected crash

Comments

@gabriel-gheorghe
Copy link
Contributor

Bevy version

Bevy 0.6.1

Operating system & version

Windows 10

What you did

Run examples/scene/scene.rs

What actually happened

thread 'main' panicked at 'scene contains the unregistered type scene::ComponentB. consider registering the type using app.register_type::()' file src\scene_spawner.rs:333:35

@gabriel-gheorghe gabriel-gheorghe added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 18, 2022
@alice-i-cecile alice-i-cecile added A-Scenes Serialized ECS data stored on the disk P-Crash A sudden unexpected crash C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy and removed S-Needs-Triage This issue needs to be labelled labels Feb 19, 2022
@tyleranton
Copy link

I was going to look into this, but the example is running fine for me. I'm running Win 11, but not sure that'd make much of a difference.

@IceSentry
Copy link
Contributor

IceSentry commented Mar 3, 2022

Could you describe the exact steps you took to run this.

Did you simply clone the repository with the main branch and then ran cargo run --example scene?

@rika
Copy link

rika commented Apr 5, 2022

Hey guys, I can reproduce this as well on Windows 10.

On a clean project with only the bevy dependency (0.6.1), copy the example code to the main.rs, also add the assets folder.
Running cargo run results in the error.

I have no idea sure why, but if I copy the same file to examples/scene.rs of this clean project and run cargo run --example scene it works.

I tried both nightly and stable toolchain.

@mockersf
Copy link
Member

mockersf commented Apr 5, 2022

This is normal if you copy the code somewhere else.
In the scene, ComponentB has been serialised as scene::ComponentB, so the struct must be declared under a root binary named scene

"type": "scene::ComponentB",

@rika
Copy link

rika commented Apr 5, 2022

Oh I didn't know that, was just testing the scene example to try to learn from it.
Thanks for the info @mockersf !

@themilkybit maybe your issue is the same misunderstanding?

@torsteingrindvik
Copy link
Contributor

Still broken on main (69760c7):

2024-01-13T14:53:16.822805Z ERROR bevy_asset::server: Failed to load asset 'scenes/load_scene_example.scn.ron' with asset loader 'bevy_scene::scene_loader::SceneLoader': Could not parse RON: 8:6: The given id is not a valid entity.

But this is likely due to e6a324a I think. FYI @Bluefinger

@Bluefinger
Copy link
Contributor

Still broken on main (69760c7):

2024-01-13T14:53:16.822805Z ERROR bevy_asset::server: Failed to load asset 'scenes/load_scene_example.scn.ron' with asset loader 'bevy_scene::scene_loader::SceneLoader': Could not parse RON: 8:6: The given id is not a valid entity.

But this is likely due to e6a324a I think. FYI @Bluefinger

This is also to do with #9907 as now the Entity format has changed so that 0 is an invalid u64 value to deserialize an Entity from. This current fix is here #11289

@janhohenheim
Copy link
Member

Closed by #11289

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Scenes Serialized ECS data stored on the disk C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy P-Crash A sudden unexpected crash
Projects
None yet
Development

No branches or pull requests

9 participants