How to get origin of collision shape2D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ulty

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

:bust_in_silhouette: Reply From: TheoTheTorch

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.