Problem with overriding rect_position and rest_size setters

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By quantumedbox

It is stated in the docs that rect_position and rect_size has setters methods _set_position and _set_size, but when i’m overriding them - they are not being called at all

func _set_size(size: Vector2):
    ._set_size(size)
    get_parent().get_node("Background").rect_size = size
    print_debug("infobox changed size to ", size)

func _set_position(pos: Vector2):
	._set_position(pos)
	get_parent().get_node("Background").rect_position = pos
    print_debug("infobox changed pos to ", pos)

Calling to set from another script:

func _process(delta):
    $Infobox.rect_position = get_viewport().get_mouse_position()
:bust_in_silhouette: Reply From: exuin

You can’t override those functions, they’re not marked virtual in the docs. Just make your own functions and call them.