Sync fixes for RigidBody3D.

This commit is contained in:
Patrick_Pluto 2024-12-19 14:01:18 +01:00
parent c0d3c68fb3
commit 8c90c4e744
4 changed files with 63 additions and 11 deletions

View file

@ -32,13 +32,16 @@ func _timer_done() -> void:
if angry_meter > 0:
angry_meter -= 1
if target is Objective:
($Label3D as Label3D).text = "%s %ds left" % [(target as Objective).displayed, angry_meter]
Networking.npc_text_sync_call("%s %ds left" % [(target as Objective).displayed, angry_meter], self)
else:
($Label3D as Label3D).text = ""
Networking.npc_text_sync_call("", self)
(target as Objective).occupied = false
timer.stop()
phase = 2
func set_text(text: String) -> void:
($Label3D as Label3D).text = text
# determines the closest resting place and navigates to it.
func find_objective() -> void:
var lowest_distance: float = 99999999999999
@ -70,6 +73,7 @@ func pick_up(node: Carryable) -> void:
node.get_parent().remove_child(node)
node.carry()
node.position = Vector3(0, 1, -1)
node.rotation = Vector3(0, 0, 0)
add_child(node)
find_player(99999999999)
phase = 3
@ -78,7 +82,8 @@ func set_down(node: Carryable) -> void:
carrying = false
node.get_parent().remove_child(node)
node.uncarry()
node.position = position + Vector3(0,0,1)
node.rotation = rotation
node.position += position
get_tree().root.get_node("/root/"+Game.mapname+"/NPCCarryables").add_child(node)
find_player(99999999999)
phase = 0