0 votes

I want to get a kinematic body position, so i can do moveandslide(firstkinematicbody - selfposition) but i dont know how to get those positions, thanks for any help.

Godot version 3.3.2
in Engine by (37 points)

2 Answers

+1 vote

You could use print(position) in your KinematicBody script

by (56 points)
+2 votes

if you are working in the body's script itself then use position variable, it is already present in your script.
if your body is a child in any other scene then you may want to use global_position
and if you are accessing any other kinematic body from a different script then you need to get its reference first by using get_node("path to the kinematic body").position

by (58 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.