So I have a node with a sprite with the following code
extends Node2D
onready var sprite = $Sprite
func set_marker_position(bounds: Rect2):
sprite.global_position.x = clamp(global_position.x, bounds.x, bounds.end.x)
sprite.global_position.y = clamp(global_position.y, bounds.y, bounds.end.y)
I keep getting a error that says cant get index x on base rect2