Skip Navigation
Posts
2
Comments
2
Joined
3 days ago
  • Thanks a lots, folks! 😄 Everything works fine now 👍đŸŧ

    What I have to do:

    1. Made don't only materials, but also meshes as unique:
     undefined
        
    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:
     undefined
        
    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))
    
      
     undefined
        
    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 🤝đŸŧ

  • Thanks a lot to everyone! I'll try it 😄

  • Godot @programming.dev
    xolatgames @programming.dev
    BOT

    Sticking of objects when those uses CharacterBody2D

    Some objects sticks with each other when those use CharacterBody2D, and moves like those are sticking together.

    So, what do I need to do to solve this issue?

    Godot @programming.dev
    xolatgames @programming.dev
    BOT

    Problems with making unique material

    Hi, folks! So, I have the problem with making materials as unique.

    I need effects, such as painting of ships in red color, will applies only where particles will spawns. But... As you can see those effects can applies also into other ships.

    I've already set these materials as "Local to Scene" into inspector tab.

    And have create script for making those materials as unique:

     undefined
        
    func _make_ship_materials_unique() -> void:
        for i in ship.get_children():
            if i is MeshInstance3D:
                for n in range(i.get_surface_override_material_count()):
                    i.mesh.surface_set_material(n, i.mesh.surface_get_material(n).duplicate(true))
    
      

    But it given me few results 😕

    If it can help, here's the script of applying of ships painting:

     undefined
        
    func damaged_spec_effect()