Hello, I’m making a tactical game with a number of player-controlled agents. I want to be able to click on an agent and have the camera follow and look at that agent, but be able to orbit that agent. I’ve currently set each agent with their own freelook camera, and have a script that enables the selected agent’s camera and disables the others. So far so good. What I’m struggling with is that each camera remembers its last position, so that when I switch, I often end up with the main camera facing a very different direction to that in which the player was last looking.
What I want:
Agent A is selected, Camera is south of A facing world north.
Player selects agent B (who is north of A)
Camera moves to just south of agent B and still faces world north.
Player rotates camera to face south, and see agent A.
Player selects agent A
Camera moves to just north of agent A and still faces world south.
What I’m getting
Agent A is selected, Camera is south of A facing world north.
Player selects agent B (who is north of A)
Camera moves to just south of agent B and still faces world north.
Player rotates camera to face south, and see agent A.
Player selects agent A
Camera moves to just south of agent A and faces world north.
Is there a way to keep the camera facing the same way in world when I switch between the freelook cameras, or would I be better to have one free look camera and change its follow and lookat properties?