Cleaning up after ChaseCamera

So I add ChaseCamera to my scene and it is working for what I need.

The tricky part I have come across is removing it (the spacial it is following goes away) in a way that I can re-add another to a DIFFERENT spacial at a later time. This means having it properly cleaned up. so a new one can be created without any side effects. Unfortunately this seems very difficult to do because of its interaction with the InputManager. First I have to call removeListener on the InputManager and pass in the camera. Then I apparently have to call deleteMapping for every one (8) of its input mappings. This seems very messy and kinda puts a usage restriction on the ChaseCamera. Any one else have any other suggestions?


if you just want to change the spatial, you don’t have to clean the inputs.

try that