The camera is no different than any other object. It has a transform; it goes where you tell it to.
So, yeah, if you tell it conflicting things, you probably won’t like the results.
A google search for “RTS camera unity” returns 10 pages of results. Including this asset as the second link, if you’d rather spend $20 than spend several days reinventing the wheel. $20 is a perfectly reasonable price if it saves you even half an hour, let alone several days, but if you can’t do that, consider this open-source one a little further down the first page of results.
But, assuming you want to reinvent the wheel, here’s how to approach it…
Your camera script will keep track of:
- a point of interest (POI), sometimes called a “focal point”, i.e. the point on the map it’s looking at
- a (possibly constant) angle up from the ground, say, 45°
- a distance from the focal point
- an angle around the Y axis
So, to find the camera position, you start at the POI, rotate a vector around by the Y angle, and up by the ground angle, and then extend it by the distance. That’s your basic camera position.
Then, if you want to maintain a constant (or minimum) distance over the ground, you cast a ray straight down from there. Get the distance to whatever it hits, and adjust the Y position of your camera accordingly. And after you position the camera, you have it LookAt the POI.
Now it should be easy to see how the various controls work: WASD moves the POI on the map (using the camera’s forward/right vectors); Q and E change the Y angle; scroll wheel changes the distance (or alternatively, the camera fieldOfView). I’m not sure what “free look” means, but perhaps it means to temporarily ignore the POI and rotate the camera in its current position directly.
This should get you started if you want to roll it yourself; otherwise, use one of the solutions above, or one of the many others that I’m sure are out there.
And I hope you will soon come to terms with what Unity does and doesn’t include out of the box. It’s not a framework for making any particular genre of game; it’s a development environment. It does not and should not provide things like an RTS-specific camera control, any more than it should have a built-in 2D destructible terrain component. What seems terribly important to you would be useless bloat to 99% of Unity developers, which is why they have a huge asset store for providing exactly those sorts of things, not to mention an enormous community providing blogs, articles, and open-source code libraries. This is all as it should be.
Cheers,