new item model and interactions
person can hold item now. Global can give item to person.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user