Strange thing happened. I have a dancer model instanced on the scene and made her local, then I overrided her materials. I ran the game and everything looks good.
When I re-scaling another object in that scene ( a sofa , painting, etc..totally unrelated to the dancer) my dancer texture still shows in editor BUT disappears at runtime.
I tried remade her local and overrided the texture again.
I tried delete and re-instance the dancer model.
I tried delete .godot folder.
None works. It will no longer show at run time no matter what.
Why would re-scaling an object in the scene affects texture override of another object? How to get texture to show again?
PS: Objects that I re-scaled have no collisionshape, only the mesh.
Well, it shouldn’t. Check the Debugger dock for some error and also check the mesh in the scene’s Remote tab and try and see if the material is the correct one.
Where are you assigning the material? to the model’s own scene or to the mesh in another scene? If the color of the node is white it means that the node is local to that scene and any changes to the original scene won’t be applied.
Post more information because there’s not enough to know for sure where the problem is.
Why are you making so many things unique? Why are you making it local? You don’t need to do that. Don’t make the scene local or the meshes unique as the data will be saved inside the scene itself making it grow in size and probably cause issues. You will also lose any modifications you do to the model afterwards as they won’t be propagated.
Just make an inherited scene from the glb file and use that inherited scene to make any modifications you need. If you need to modify something in any instance of that scene then: ideally, the inherited scene should have a small script taking care of that or, alternatively, enable Editable Children and make the changes there.
I see. My dancer.glb has 4 animations for each of them so I just instanced one and duplicated it. I learn that to change material or animation of duplicated scene you’d need to make it local but I guess this is not an effective/efficient way of doing it (and possibly buggy).
** Actually now I’m a bit confused
I should now make 4 inherited dancer scenes and apply changes there instead(?) I would still need to make the mesh unique in order to change material, right?
Or I should make only one inherited scene and somehow script it to have different material with each instanced.
I guess basically my question is How should I instance 4 different dancers from the same dancer.glb with 4 animations, 4 external textures, and 4 external hair meshes?
UPDATE :
Well, I just have to follow your instructions and this is what I did:
make one inherited scene
attach script:
@tool
extends Node3D
@export var body_material : Texture
@onready var mesh = $A_BODY_FOOT_RIG/Skeleton3D/DANCEGIRL
func _ready() -> void:
var material_one = mesh.get_surface_override_material(0)
material_one.albedo_texture = body_material
mesh.set_surface_override_material(0, material_one)
Instance it, edible children, then make each instance mesh unique
Change each instance’s export texture.
Change animation / Add bone attach hair mesh to each instance.
Where did you learn that? That’s wrong. There’s no need to make local the mesh itself. MeshInstance3D already has a way to override the Mesh materials with MeshInstance3D.set_surface_override_material() or under the Surface Material Override group in the inspector.
Unless you are modifying the Mesh resource itself (like adding/removing/modifying its vertices or something like that in code) you do not need to make the it unique.
Just internet questions I came across - if you want different material for duplicated scene then make it local.
you do not need to make the it unique.
Then how do you apply different material to each instance? With that code If I don’t make the mesh unique then only one material will be applied to all instances.
This shows the properties of texture after I load the @export material. It stays like this after I run the game, click other object in the scentree ..etc.