feat: Add initial player scene with character models and effects, implement core lobby UI and functionality, and introduce a 3D outline shader.
This commit is contained in:
@@ -438,6 +438,26 @@ func set_character(character_name: String) -> void:
|
||||
anim_player.root_node = anim_player.get_path_to(active_character)
|
||||
# Start with idle animation
|
||||
play_idle_animation()
|
||||
|
||||
# Apply outline shader to the active character
|
||||
if active_character:
|
||||
_apply_outline_recursive(active_character)
|
||||
|
||||
func _apply_outline_recursive(node: Node):
|
||||
if node is MeshInstance3D and node.mesh:
|
||||
for i in range(node.mesh.get_surface_count()):
|
||||
var mat = node.get_active_material(i)
|
||||
if mat:
|
||||
# Only apply if it doesn't already have a next pass
|
||||
if not mat.next_pass:
|
||||
var unique_mat = mat.duplicate()
|
||||
var outline_mat = ShaderMaterial.new()
|
||||
outline_mat.shader = load("res://assets/shaders/outline3d.gdshader")
|
||||
unique_mat.next_pass = outline_mat
|
||||
node.set_surface_override_material(i, unique_mat)
|
||||
|
||||
for child in node.get_children():
|
||||
_apply_outline_recursive(child)
|
||||
|
||||
@rpc("any_peer", "call_local", "reliable")
|
||||
func sync_character(character_name: String) -> void:
|
||||
|
||||
Reference in New Issue
Block a user