0 votes

It could be any method you can think of. Is there a way to get CollisionPolygon2D sibling on each frame?

Godot version 3.4
in Engine by (17 points)
retagged by

1 Answer

0 votes

You didn't provide much to go on but, generally speaking, you can get sibling nodes
of the current node using something like this:

var children = get_parent().get_children()

Note, that collection will also include the current node (as it's also a child of its parent).

Regarding doing it every frame - you could just place the code in _update(), though is that really what you want to do?

Perhaps a more detailed explanation of your goal would be helpful.

by (12,473 points)

I was trying to animate CollisionPolygon2D coupled with sprite animation. I did think of a way, but the process was kinda long and it was kind of pain.

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.