0 votes

How can I get the Vector2 () value for RigidBody2D?

func _on_Zona_body_entered(body):
in Engine by (42 points)
edited by

1 Answer

+1 vote
Best answer

Not sure what Vector2 you're after - I assume the position? If that's the case you get it just like any node that inherits from Node2D - via its position property.


$RigidBody2D.position # - position relative to its parent
$RididBody2D.global_position # - global position
by (16,798 points)
selected by

I did not indicate one nuno thing. I have such a code, and it is necessary that with the help of a pulse one RigidBody 2D move to another.

func _on_Zona_body_entered(body):
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 Frequently asked questions and 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 [email protected] with your username.