0 votes

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

Godot version 3.3.2 Stable
in Engine by (71 points)
edited by

1 Answer

0 votes

I think this will work

var rectposy

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
by (16 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.