working on start room

This commit is contained in:
Clevertop 2024-08-10 21:26:51 +10:00
parent 8cceafb10c
commit 6fe8b66184
7 changed files with 164 additions and 33 deletions

View file

@ -3,15 +3,16 @@ extends RigidBody3D
class_name Command_Block
@export var command_name : String
@export var command_sprite : Texture2D:
set(new_texture):
if command_sprite != null:
command_sprite.changed.disconnect(on_texture_changed)
command_sprite = new_texture
command_sprite.changed.connect(on_texture_changed)
@export var command_sprite : Texture2D#:
#set(new_texture):
#if command_sprite != null:
#command_sprite.changed.disconnect(on_texture_changed)
#command_sprite = new_texture
#command_sprite.changed.connect(on_texture_changed)
# Called when the node enters the scene tree for the first time.
func _ready():
$MeshInstance3D.material_override = $MeshInstance3D.material_override.duplicate()
$MeshInstance3D.material_override.albedo_texture = command_sprite
pass # Replace with function body.
@ -20,7 +21,7 @@ func _ready():
func _process(delta):
pass
func on_texture_changed():
print("meow")
$MeshInstance3D.material_override = $MeshInstance3D.material_override.duplicate()
$MeshInstance3D.material_override.albedo_texture = command_sprite
#func on_texture_changed():
#print("meow")
#$MeshInstance3D.material_override = $MeshInstance3D.material_override.duplicate()
#$MeshInstance3D.material_override.albedo_texture = command_sprite