xolatgames

joined 8 months ago
[โ€“] xolatgames@programming.dev 1 points 8 months ago

I personally don't know ๐Ÿคท๐Ÿปโ€โ™‚๏ธ. I've try both variants.

[โ€“] xolatgames@programming.dev 1 points 8 months ago (2 children)

Thanks a lots, folks! ๐Ÿ˜„ Everything works fine now ๐Ÿ‘๐Ÿผ

Image

What I have to do:

  1. Made don't only materials, but also meshes as unique:
var new_model = model.front.duplicate(true)
var new_ship: Node3D = new_model.instantiate()
new_ship.position = front_model_pos
_model_parent.add_child(new_ship)
_make_ship_materials_unique(new_ship)
  1. Change mesh.surface_set_material to mesh.set_surface_override_material:
func _make_ship_materials_unique(new_ship: Node3D) -> void:
	for i in new_ship.get_children(true):
		if i is MeshInstance3D:
			for n in range(i.get_surface_override_material_count()):
				i.set_surface_override_material(n, i.mesh.surface_get_material(n).duplicate(true))
func damaged_spec_effect() -> void:
	for i in ship.get_children(true):
		if i is MeshInstance3D:
			for n in range(i.get_surface_override_material_count()):
				_create_fade_in_then_out_effect(i.get_surface_override_material(n), Color.RED)

And everything started works as well. Thanks again ๐Ÿค๐Ÿผ

[โ€“] xolatgames@programming.dev 2 points 8 months ago (4 children)

Thanks a lot to everyone! I'll try it ๐Ÿ˜„

view more: โ€น prev next โ€บ