-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Make parenting example clearer on parenting rules for newcomers #4116
Conversation
For new users (me included!) coming from engines like Unity, it's easy to not be aware that a parent must also have a GlobalTransform along the obvious Transform. They then ask themselves why their hierarchy doesn't work properly when using a single Transform instead of a PbrBundle.
examples/3d/parenting.rs
Outdated
@@ -34,12 +37,18 @@ fn setup( | |||
..default() | |||
}); | |||
|
|||
let capsule_handle = meshes.add(Mesh::from(shape::Capsule::default())); | |||
let capsule_material_handle = materials.add(StandardMaterial { | |||
base_color: Color::rgb(0.7, 0.8, 0.6), |
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.
I think color constants are generally more legible in these examples.
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.
Yes. I tried to keep the consistency with how the example was before, but I can change these for sure.
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.
Yep, may as well tidy up a bit while we're here :)
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.
Actually, I'm going to use a single material for all meshes to simplify the example and focus it more on the parenting. I'll keep the capsule though to keep comments clear and not have multiple "child cubes".
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.
I like it :) Just a couple of nits to clean up, but I think this is a nice step in the right direction.
Remove distinct material for capsule and use simpler Color for material
Remove notion of "empty"
Make it more future-proof. Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: François <mockersf@gmail.com>
Closing as part of backlog cleanup, likely to have significant bit rot after two years. @dtaralla, if you feel this would still be a good change please feel free to open another PR. Cheers! |
For new users (me included!) coming from engines like Unity, it's easy to not be aware that a parent must also have a GlobalTransform along the obvious Transform.
They then ask themselves why their hierarchy doesn't work properly when using a single Transform instead of a PbrBundle like in the example.
Objective
Solution