- Home /
toggle being a child
So I want to be able to be stuck to my character, unless I hit y which would let me roam about the map.
Sorry, i didn't mean to enter that.
I know what to do about panning, and the toggleing Y itself. What i need to know how to attach and detach the camera from the gameobject.
Comment
I'd make a game object to hold the camera's position as it's supposed to be when it's "stuck" to the character so I could reset the camera easily.
Then I'd probably make a reference to that object in the camera control script and when the user hits 'Y' I'd call my ResetCamera()
method to move and rotate the camera to that initial setup. Then all that's left is just to set the camera's transform.parent
property to that object and it's all good.