![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Lajbert |
Hey,
I have a scene that looks like the following:
Root [Spatial]
+--- Child_1 [MeshInstance]
+--- Child_2 [MeshInstance]
When I instantiate the scene, I want to cast it to Spatial, but I get an exception saying it can’t be casted as it’s not spatial.
The following code confirms that the object is spatial:
GD.Print(child.Name + ", type: " + child.GetClass() + ", is it Spatial? " + (child is Spatial));
Output:
SpikeTrap, type: Spatial, is it Spatial? False
The GetClass() clearly returns ‘Spatial’, so why is ‘child is Spatial’ false?
Thanks