0 votes

OK, I found the answer to my question myself, but for anyone else who might also be confused, I will document it here:

You can get the position i.e. origin of a collision shape by using

shape_owner_get_transform()

on a CollisionObject2D --> (Area2D/KinematicBody2D...)

The "owner" is the index of the shape if there is only one then just use 0.

-
Example:

Area2D_01.shape_owner_get_transform(0).origin

myKinBody2D_01.shape_owner_get_transform(0).origin

-
Hope this helps

Godot version 3.2.3
in Engine by (156 points)
edited by

1 Answer

+1 vote
Best answer

It's cool you've found the answer, I'm just writing this so that this question won't be classified as unanswered. Maybe that would even help someone clicking this, since they won't think that this question hasn't been aswered.

by (106 points)
selected by
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.