new item model and interactions

person can hold item now. Global can give item to person.
This commit is contained in:
Nikolai Fesenko
2025-08-18 01:33:54 +02:00
parent a62d2e29bc
commit 7ba255334d
16 changed files with 392 additions and 6 deletions

View File

@@ -14,6 +14,11 @@ var action: Interactable
var is_target_reached: bool
var timer: Timer
var is_holding_item: bool = false
var holdingItem: Object
func _ready() -> void:
nav_agent = $NavigationAgent3D
meshI = $MeshInstance3D
@@ -28,6 +33,8 @@ func _ready() -> void:
is_in_action = false
timer = $Timer
Global.give_item(self, 0)
#nav_agent.target_position = Vector3(-15.955,3.486,-58.942)
func _physics_process(delta: float) -> void:
@@ -79,3 +86,14 @@ func _on_timer_timeout() -> void:
if action != null:
print("action stoped")
action.stop_action(self,target_object)
func hold_item(item):
var newItem = item.instantiate()
holdingItem = newItem
newItem.position = Vector3(0,0.976, -0.065)
self.add_child(newItem)
func drop_item():
pass