added bow cursor that swaps when charged shot is selected

This commit is contained in:
derek
2025-06-26 11:44:12 -05:00
parent 78d8ab4b10
commit e1b09df8f4
6 changed files with 39 additions and 3 deletions

View File

@@ -2,8 +2,23 @@ extends Node3D
@export var player : Player
@onready var sword_cursor: Node3D = $SwordCursor
@onready var bow_cursor: Node3D = $BowCursor
func _process(delta: float) -> void:
follow_mouse()
swap_models()
look_at(player.global_position, Vector3.UP)
func follow_mouse():
var mouse_pos = MousePos.get_mouse_world_position(00001000)
if mouse_pos != null:
global_position = Vector3(mouse_pos.x,.1,mouse_pos.z)
look_at(player.global_position, Vector3.UP)
func swap_models():
if Input.is_action_pressed("ranged_attack"):
sword_cursor.visible = false
bow_cursor.visible = true
else:
sword_cursor.visible = true
bow_cursor.visible = false