SpielBackupAlt/scripts/Lamp.gd

22 lines
377 B
GDScript3
Raw Permalink Normal View History

2024-12-26 14:54:06 +00:00
extends StaticBody
var on = false
export var meshPath : NodePath
onready var mesh : Node = get_node(meshPath)
var material
func _ready():
$Light.hide()
material = mesh.get_surface_material(0)
func interact(_relate):
if on:
on = false
$Light.hide()
material.emission_energy = 0
else:
on = true
$Light.show()
material.emission_energy = 2