#How to query for PbrBundle by _Color_?

3 messages · Page 1 of 1 (latest)

tight mural
#

Is there a way to query for (and have access to) a PbrBundle's Color? ...that is its material parameter.

I've gotten tied up in knots with expressions like:

Query<&dyn Material<Data = Color>>

(which of course does not work/compile)

I think I'm on the wrong track entirely. 🤷

mystic birch
#

You should be able to do a Query<Handle<StandardMaterial>> and then when you need the data you also need a materials: Res<Assets<StandardMaterial>> and get it with materials.get(handle) or at least something like that

#

You can't get the color on it's own since it's just a field on the StandardMaterial and not it's own component