Hi,
I’m having trouble with changing parents at run-time. I have an object that is rotating slowly and when the camera approaches the object, I make the camera a child of the object. I do this because I want it’s rotation and position to follow the object’s movements. I would use a script to just update the camera’s position, but the camera is user-controlled and I want the user to be able to move around the object after being parented.
At the moment I parent the camera, though, it’s rotation snaps to match that of the object. I don’t want that behavior - I want the camera to have the same global rotation that it had before being parented.
I’m thinking right after I parent the camera I have to figure out the difference of it’s pre and post parenting rotation and set it to that, but I can’t figure out what methods to call on the camera - I’m a bit new to local/world space issues.
Any help is much appreciated!