How do I get my button to move

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

So far, everything I have done resulted in an error with this version giving me this error:
Attempt to call function ‘position’ in base ‘null instance’ on a null instance.

extends Position2D


var rngx = RandomNumberGenerator.new()
var rngy = RandomNumberGenerator.new()
func _on_Button_button_down() -> void:
    var x = int(rngx.randf_range(0,1024))
    var y = int(rngy.randf_range(0,600))
    $self.position(x,y)

Just in case, here's my nodes so far

What should I do?

:bust_in_silhouette: Reply From: Inces

Your error happened because if incorrect reference to position 2d node. No $ is needed when You use self

about buttons itself, all control nodes use rect_position instead of position