Hi, I recently picked godot again and finally decided to actually finish a project on it, but now I have hit a problem that apparently no solutions from searches seem to work or be even close to what I need.
Is there a way to, as simply as possible, set a sub-material of a mesh to a specific spatialmaterial resource?
Even if this is inefficient I simply want to switch two materials to "simulate" a light effect on a glass part of a model that should look like it was lit up (I don't want to deal with textures yet, I am trying to keep this project as simple as I can so I can learn progressively.)
I am using this structure for my object:

And I want to edit this parameter through the script:

What I have currently on my code, or at least what I would like to do in logic:
extends Node
var on = false
remote func toggle():
var light = get_node("Light")
on = !on
if on == true:
light.visible = true
set_material(2, "res://Objects/Flashlight/Glass_instance.material")
else:
light.visible = false