I am raycasting against objects in my scene and I am trying to look for CSGShapes, however the only thing that shows up are instances of ImmediateGeometry (I dont have any ImmediateGeometry in my scene).
According to the documentation CSGShapes dont inherit from ImmediateGeometry, what's going on here? Additionally, when I give one of these nodes a new CSGShape as a child during runtime, they dont seem to combine.
Here is the relevant piece of code.
# result is from raycast
var col_children = result["collider"].get_parent().get_children()
# CSGShape is a sibling of the CollisionShape
for i in col_children:
if i.is_class("ImmediateGeometry"):
# This is never ran when set to "CSGShape"
if Input.is_action_just_pressed("shoot"):
var inst = CSGCylinder.new()
inst.translation = translation - i.translation
inst.rotation = rotation - i.rotation
inst.radius = get_child(0).radius
inst.height = get_child(0).height
i.add_child(inst)
inst.set_owner(i)
print("%s parent of %s" % [i, inst])
# [ImmediateGeometry:1269] parent of [CSGCylinder:1338]