I am trying to have a camera in a fixed position rotate to follow the player (capsule) as he moves around on this platform. The player can freely move in any direction, but I don’t want the camera to try to maintain a constant distance. I want its x and z position fixed. I’d also like the camera to follow the player’s y position, so it will follow the player up and down as it, for example, jumps or climbs stairs.
I have a very similar problem, I have to be able to set the camera at 0,0,0 and have it rotate to follow the player from a considerable distance. If i come up with something I’ll try to share it.
I found this on the script reference page, it gets the ball rolling at least, plug in the code into the camera and set it to your player, I just need to figure out how to get it to zoom in…
I don’t know if i understand you correctly, but how about this approach.
Attach a Script to the camera-gameoject. In Awake/Start grab a reference to the Player (or drag n drop the player to the Script in Editor when the player is not instantiated). Calculate the difference in YPos between Player and Camera.
In the Update-Function of the Cam-Script you can change the Rotation per Lookat and adjust the y-Pos of the Camera accoording to the difference you Initially saved and the current position of the player.