Axis of the region_rect

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

Hi I am trying to extract the Y axis from region_rect, using the code:

	var region = $Texture/Main/texture_main.get_region_rect(Vector2.AXIS_Y)
$Texture/Shadow/Shadow.region_rect = Rect2(384, region, 64, 64)

In order to use it in another region, I flipped through the documentation but did not quite understand how to handle one axis value

:bust_in_silhouette: Reply From: TheWarmWaffle

I think this will work

var rect_pos_y

func _physics_process(delta):
    rect_pos_y = $Texture/Shadow/Shadow.region_rect.position.y
    # you can also do region_rect.size.y, and region_rect.end.y