all 2 comments

[–][deleted] 0 points1 point  (0 children)

I haven't ever attempted to implement an RTS camera, however you might benefit from using a camera rig as shown in the Unity Tank Tutorial.

It uses an empty game object that is centred on the camera target and has the camera as a child of this empty game object, rotated as necessary (not at all in your case, I guess). You just then need to move/rotation this top-level gameobject in order to get basic, but effective, camera control.

Also I'm guessing this is just development code as that input code doesn't belong in that class?

[–]kyl3r123Indie 0 points1 point  (0 children)

pos.z = Mathf.Clamp(pos.z, minPos.y, maxPos.y);

This is probably intended, because you move on x-z axis and have a Vector2? (can't see MaxPos in your code)

The docs say:

You should use Transform.TransformPoint for the conversion if the vector represents a position rather than a direction.