0 votes

Which function loads the finished material shader (shader_1.tres) ?

MeshInstance3D > GeometryInstance3D > Geometry > MaterialOverride

extends MeshInstance3D

@onready var shaderA = preload("res://3d/Shader/material_shader_1.tres")

func _ready():
#   self. load material shader func ????????
    pass
Godot version Godot 4.x
in Engine by (27 points)

Here's a simple solution.
You need to create and save a material (name_material.tres)

extends MeshInstance3D


@onready var shaderA = preload("res://3d/Shader/material_shader_1.tres")

func _ready():

    self.material_override = shaderA

    pass

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.