Hi,
so I am making an RTS type of game and I already have scripts that lets me move, rotate, pan, and zoom the camera the way i want to. I also have scripts that let me place objects and select so i can do stuff with them. Now the one thing i would need help with is that when i select the object press a button that pops up (which i have working) that the camera would move to a position close to the object and stay there in a fixed position then return back to normal moving camera (like pressing escape or something to get back to normal moving camera). I basically know what i need to do like store the cameras position in a variable as well as the objects position (probably using transform) then calculating the offset between the two points and using vector3.lerp to smoothly move it to that position.
I’ve looked around the web quite a bit to figure out how i would put it into code form but didnt have any luck yet. I don’t need anyone to give me the entire code but more like the general structure like what functions to use or even just describing how i should do it would be more than enough. Thanks in advance.