objects can be selected

This commit is contained in:
Nikolai Fesenko
2025-08-20 14:31:53 +02:00
parent b5d5d4a818
commit 9bab0ff0f3
5 changed files with 109 additions and 14 deletions

View File

@@ -25,6 +25,8 @@ var target_item
var target_action: String
var is_selected: bool = false
func _ready() -> void:
nav_agent = $NavigationAgent3D
meshI = $MeshInstance3D
@@ -112,3 +114,23 @@ func _on_item_received():
if holdingItem != null:
pass
#holdingItem.use()
func _on_input_event(camera: Node, event: InputEvent, event_position: Vector3, normal: Vector3, shape_idx: int) -> void:
pass
func _on_mouse_entered() -> void:
Global.object_over_mouse_selected_signal.emit(self)
enable_outline()
func _on_mouse_exited() -> void:
if is_selected == false:
disable_outline()
func enable_outline():
$MeshOutline.visible = true
func disable_outline():
$MeshOutline.visible = false