25 lines
607 B
GDScript
25 lines
607 B
GDScript
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)
|
|
|
|
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
|