You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can see the logs printed, so I'm pretty certain that those branches are executed as expected. I also tried inserting debug logging of the material handles themselves, and I could see that they are changed too and no system changes them back somewhere in the middle.
@memoryruins suggested me in the Discord that I try to edit the material itself, like so:
if let Some((material, _)) = controllable_object {
materials.get_mut(material.clone()).unwrap().albedo = if contacting {
Color::rgb(0.85, 0.1, 0.1)
} else {
Color::rgb(0.87, 0.87, 0.87)
};
}
After applying these changes, I could see the object rendered in different colours.
My guess is that Bevy's renderer doesn't detect changes in entities' material handles, so this is probably a bug.
The text was updated successfully, but these errors were encountered:
An example where this can be reproduced: https://github.com/mvlabat/muddle-run/blob/b2fc5d91a6b6d81ee94029924507db0acdedc42d/bins/desktop_client/src/main.rs.
This is where I define two different materials: https://github.com/mvlabat/muddle-run/blob/b2fc5d91a6b6d81ee94029924507db0acdedc42d/bins/desktop_client/src/main.rs#L55-L70
And this is the code where I swap the handles: https://github.com/mvlabat/muddle-run/blob/b2fc5d91a6b6d81ee94029924507db0acdedc42d/bins/desktop_client/src/main.rs#L328-335
I can see the logs printed, so I'm pretty certain that those branches are executed as expected. I also tried inserting debug logging of the material handles themselves, and I could see that they are changed too and no system changes them back somewhere in the middle.
@memoryruins suggested me in the Discord that I try to edit the material itself, like so:
After applying these changes, I could see the object rendered in different colours.
My guess is that Bevy's renderer doesn't detect changes in entities' material handles, so this is probably a bug.
The text was updated successfully, but these errors were encountered: