How do you allow child nodes to have their own material?

Seems like child nodes inherit the material of their parent, is there a way to turn this off? I want my background to be grouped together like in the lesson, but i want the children to use different materials.

Not quite, although you’re not far off. This has to do with an annoying problem in Godot’s design: copying, and even duplicating nodes will, by default, only create references to any resources used by those nodes. Materials are one example of such resources, but pretty much anything that has a Resource tab at the bottom of its inspector will be affected by this. It’s done for performance reasons so that copying a node 50 times doesn’t result in 50 identical copies of those resources, but unfortunately, opting out of this on a case-by-case basis is less intuitive than it should be.

I am still conducting some experiments for myself to pin down the best practice for getting around this, but the one thing I’ve found so far that works consistently is to copy and paste the node into an empty scene, and then cut and paste it from there back into the original scene. You would have to do this once for each variant you need; then you can copy those variants normally.

This seems to work both for non-scene branches and for instantiated scenes, but not for inherited scenes (which is fine most of the time, as you can just copy from the original scene instead of the inherited one. If that doesn’t make sense, don’t worry, inheritance isn’t covered until much later). Anyway, give that a try and see if it works for you =)

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms