Open Ughuuu opened 2 hours ago
As a workaround I try to get the RID by doing something like this:
var parent = node.get_parent()
if parent is CollisionObject2D:
var idx = 0
for child in parent.get_children():
if child == node:
break
idx += 1
rid = PhysicsServer2D.body_get_shape(parent.get_rid(), idx)
However this doesn't work for cases where the shape isn't parented to a CollisionObject2D or when it's disabled.
A CollisionPolygon2D
does not have a get_rid()
function because it has no RID
as it is not a CollisionObject2D
.
A CollisionPolygon2D is a helper node for a parent CollisionObject2D node, so it is mostly dysfunctional without such parent.
Tested versions
4.3
System information
macos
Issue description
It is impossible to get the
RID
of aCollisionPolygon2D
right now. Any other thing has a way to get RID property, which let you access directly thePhysicsServer2D
if you want with that RID. Except theCollisionPolygon2D
.Steps to reproduce
Create a
CollisionPolygon2D
node. There is noget_rid()
property.Minimal reproduction project (MRP)
-