-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix scene example #11289
Fix scene example #11289
Conversation
@@ -5,7 +5,7 @@ | |||
), | |||
}, | |||
entities: { | |||
0: ( | |||
4294967296: ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use a random number and not 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not random :')
I've updated the first line in the PR description to be more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, maybe add a comment so its more clear why that number is being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly the entire example is flawed and bound to be reworked when proper scene infrastructure rolls around, hopefully soon. Not sure if it's worth documenting at this point, you honestly just should not do serialization the way this example does, but I don't think deleting the example is an option
If that fixes an example I'm all for it :D That said ; isn't the root cause using Footnotes
|
Yep. This entire way of serializing entities is terribly flawed, but the example exists as-is so it's better if it actually works. |
Since #9907 the generation starts at
1
instead of0
soEntity::to_bits
now returns4294967296
(ie.u32::MAX + 1
) as the lowest number instead of0
.Without this change scene loading fails with this error message:
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: Invalid generation bits