Added Itemsmanager
Items now can be stored. I wanna kill myself
This commit is contained in:
@@ -19,12 +19,13 @@ var is_holding_item: bool = false
|
||||
var holdingItem: Object
|
||||
|
||||
|
||||
var target_item: int
|
||||
|
||||
func _ready() -> void:
|
||||
nav_agent = $NavigationAgent3D
|
||||
meshI = $MeshInstance3D
|
||||
shirt_shader = meshI.get_surface_override_material(1)
|
||||
|
||||
BuildManager.object_added.connect(_on_object_added)
|
||||
|
||||
set_random_shirt()
|
||||
|
||||
@@ -33,8 +34,7 @@ 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:
|
||||
@@ -46,10 +46,10 @@ func _physics_process(delta: float) -> void:
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("test"):
|
||||
set_target_position()
|
||||
ItemManager.set_person_target_item(self, "food")
|
||||
#set_target_position()
|
||||
|
||||
|
||||
func _on_object_added(object):
|
||||
set_target(object)
|
||||
|
||||
|
||||
func set_random_shirt():
|
||||
@@ -63,6 +63,7 @@ func set_target(object):
|
||||
#if !is_in_action and object.ActionNode.can_be_used():
|
||||
if !is_in_action:
|
||||
target_object = object
|
||||
set_target_position()
|
||||
#nav_agent.target_position = target_object.ActionNode.global_position
|
||||
func set_target_position():
|
||||
is_target_reached = false
|
||||
@@ -70,7 +71,7 @@ func set_target_position():
|
||||
newPos.y = self.position.y
|
||||
nav_agent.target_position = newPos
|
||||
print(target_object.ActionNode.can_be_used())
|
||||
|
||||
|
||||
#nav_agent.target_position = start_pos
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user