I want to exclude the already placed modules from the recasting. I have read that I can use
var query = PhysicsRayQueryParameters3D.create(start, end)
query.exclude = [modules]
but that requires that the array is a list of RIDs and not my actual nodes of all the modules.
What is the best way to get all the RIDs of all the modules in an array?
Or is there a better way to make sure that the ray cast is ignoring the already placed modules?
Do you mean that they have multiple collision shapes? Like a StaticBody3D with a bunch of CollisionShape3D or CollisionPolygon3D children? If that’s the case you won’t be able to filter them this way. Only bodies have a RID.
The returned Dictionary of PhysicsDirectSpaceState3D.intersect_ray() has the shape index of the intersection but that index is an internal one that may or may not be the same as the one in the scene.