I hope that made sense! Ok, backstory: so basically have a spatial that is a rock with a LightControl added to it. I am using a LightControl because I already have an AmbientLight attached to this rock (you can’t attached more than 1 light to a spatial?). The LightControl’s light is attached to the rootnode, but the LightControl itself is attached to the spatial so that it will move where the spatial moves.
My problem: when my in-game character destroys one of these rocks, I am removing the rock from the physics space and removing it from the rootnode, however… even though I remove the LightControl, it’s light is still attached to the rootnode.
In my physics collision listener, I’m getting the rock spatial object through “event.getNodeA()” as you would expect… but what I haven’t been able to figure out is how to reference the light that the LightControl is parenting. I can get to the LightControl’s reference with “event.getNodeA().getControl(1)” but that doesn’t return as a LightControl, only as a Control, so the accessible properties and methods aren’t of a LightControl.
FYI… my constructor for the rock and its LightControl are global and I instantiate a new object from that, each time, within the function call for generating a new rock/light.
Any thoughts?
Thank you!