Hello Devs,
When I press a key, I want the camera to move to the target gameobject. I am trying make a UI menu where when you press the key it goes to another section of the menu. In order to translate the camera the code I am using is
void trans()
{
transform.Translate(-Time.deltaTime*10, Time.deltaTime*10, 0, Space.World);
}
I want to halt it when it reaches that position.
Problem :
The camera translates but as the key press is for only a single frame it does not go beyond it. I would like the translation to be locked down to a particular x and y so as that the required gameobject is within screen. Devs, thanks.