messing around with path3d stuff

This commit is contained in:
Clevertop 2024-08-12 00:10:55 +10:00
parent 34fed07cc6
commit e9a896a912
4 changed files with 32 additions and 25 deletions

View file

@ -1,21 +1,22 @@
#@tool
@tool
extends RigidBody3D
class_name Command_Block
#TODO make this all an enum
@export var command_name : String
@export var command_sprite : Texture2D#:
@export var mesh : MeshInstance3D
@export var command_sprite : Texture2D:
set(new_texture):
command_sprite = new_texture
mesh.material_override = mesh.material_override.duplicate()
mesh.material_override.albedo_texture = command_sprite
@export var collider : CollisionShape3D
var spawn_pos : Vector3
#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
mesh.material_override = mesh.material_override.duplicate()
mesh.material_override.albedo_texture = command_sprite
spawn_pos = global_position
pass # Replace with function body.
@ -27,7 +28,4 @@ func _process(delta):
linear_velocity = Vector3(0,0,0)
pass
#func on_texture_changed():
#print("meow")
#$MeshInstance3D.material_override = $MeshInstance3D.material_override.duplicate()
#$MeshInstance3D.material_override.albedo_texture = command_sprite