A team game with an emphasis on movement (with no shooting), inspired by Overwatch and Zineth
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
541 B

  1. extends Label
  2. var camera
  3. var pos
  4. func _ready():
  5. pos = get_node("../NamePosition")
  6. func _process(delta):
  7. # This needs to happen here because players are added later
  8. # Plus, the camera changes when a player switches hero
  9. camera = util.get_master_player().get_node("TPCamera/Camera")
  10. var pos3d = pos.get_global_transform().origin
  11. if camera.is_position_behind(pos3d):
  12. hide()
  13. else:
  14. show()
  15. var size = get_size()
  16. var offset = Vector2(size.x/2, size.y) # Origin at bottom
  17. set_position(camera.unproject_position(pos3d) - offset)