Hello!
I’m not sure if this is just a me issue, but when two players were both standing on the same plate it would trigger the bridge activation.
I solved this by adding an @export var for the area_collision: Area2D and checking the overlapping_bodies().size in both the _on_area_2d_body_entered(_body) func, and the _on_area_2d_body_exited(_body) func and making sure it doesn’t doubly add a body count on the same pressure plate:
@export var area_collision: Area2D
func _on_area_2d_body_entered(_body):
if multiplayer.multiplayer_peer == null:
return
if not multiplayer.is_server():
return
#print("area_collision.get_overlapping_bodies().size() entered: " + str(area_collision.get_overlapping_bodies().size()))
if area_collision.get_overlapping_bodies().size() > 1:
return
bodies_on_plate += 1
update_plate_state()
func _on_area_2d_body_exited(_body):
if multiplayer.multiplayer_peer == null:
return
if not multiplayer.is_server():
return
#print("area_collision.get_overlapping_bodies().size() exited: " + str(area_collision.get_overlapping_bodies().size()))
if area_collision.get_overlapping_bodies().size() > 0:
return
bodies_on_plate -= 1
print(bodies_on_plate)
update_plate_state()
There’s probably an easier way to do this, but this is how I did it if it helps anyone else!