I need help with this 2d tutorial that im turning 3d. here's the code

Godot Version

Godot 4

Question

`I don’t know why it says this:
func _process(delta):
if active_areas.size() > 0 && can_interact:
active_areas.sort_custom(_sort_by_distance_to_player)
label.text = base_text + active_areas[0].action_name
label.global_position = active_areas[0].global_position
label.global_position.y -= 36
(This right here)label.global_position.x -= label.size.x / 2
label.show()
else:
label.hide()

func _sort_by_distance_to_player(area1, area2):
var area1_to_player = player.global_position.distance_to(area1.global_position)
var area2_to_player = player.global_position.distance_to(area2.global_position)
return area1_to_player < area2_to_player

func _input(event):
if event.is_action_pressed(“interact”) && can_interact:
if active_areas.size() > 0:
can_interact = false
label.hide()

		await active_areas[0].interact.call()
		
		can_interact = true

(This right here)label.global_position.x -= label.size.x / 2
it says: Invalid get index ‘size’ (on base: ‘Label3D’).

what am i supposed to change it too or what do i do to fix it pls tell me it as simple as possible pls

try label.width instead of label.size

(it now says can’t find width member in base label):
but thanks for trying do you think you can solve this

If you look here in the last row there is a width property, you should be able to use that.
Like so: label.global_position.x -= label.width / 2

thanks