add kickable tooltips

This commit is contained in:
2026-04-23 14:44:21 +03:00
parent 5f61c26563
commit 5d9b0ce738
6 changed files with 108 additions and 0 deletions
+18
View File
@@ -14,9 +14,27 @@ var fly_vel: Vector3 = Vector3.ZERO
var damage_modifier: float = 0.0
@onready var mesh_node: MeshInstance3D = $LeatherMesh
var _tooltip: Label3D
func _ready() -> void:
add_to_group("kickable")
_tooltip = Label3D.new()
_tooltip.text = "Leather\n+Stick → Boots\n+Rock → Leather Armor\n+Iron → Iron Shield"
_tooltip.billboard = BaseMaterial3D.BILLBOARD_ENABLED
_tooltip.font_size = 28
_tooltip.outline_size = 6
_tooltip.position = Vector3(0, 1.0, 0)
_tooltip.modulate = Color(1.0, 0.95, 0.8)
_tooltip.visible = false
add_child(_tooltip)
func _process(_delta: float) -> void:
if state != State.IDLE:
_tooltip.visible = false
return
var players := get_tree().get_nodes_in_group("player")
_tooltip.visible = not players.is_empty() and \
(players[0] as Node3D).global_position.distance_to(global_position) < 2.5
func apply_collision_damage(_dmg: float) -> void:
pass