-
Probably obvious to non-newbies--tia for your answer & tolerance! I want objects to glow (be emissive) and shed light on surrounding objects (with a PointLightBundle) as I hover over them, then return to their former state when I stop hovering. But when I try to remove the PointLightBundle (the very bottom of this code, my hacked standard bevy_mod_picking minimal.rs) the whole object disappears. Why?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
By removing the whole bundle, you end up removing the critical |
Beta Was this translation helpful? Give feedback.
-
Most of the time,
When you remove It's a bit of a fluke that |
Beta Was this translation helpful? Give feedback.
Most of the time,
PointLightBundle
andPbrBundle
and otherBundle
s aren't meant to be inserted onto the same entity. (A notable exception isPickableBundle
, which you're using properly.PointLightBundle
andPbrBundle
both share a subset of components:Transform
,GlobalTransform
,Visibility
,InheritedVisibility
, andViewVisibility
which are required for them to do their things.When you remove
PointLightBundle
, you are removing those required components.It's a bit of a fluke that
insert(PointLightBundle)
on an existingPbrBundle
is doing what you want. This won't be the case for most built-in Bevy bundles. You should spawn a separatePointLightBundle
entity as a child of yourPbrBundle
en…