Hi, I’m trying to move the camera from a certain view one gameobject to another one based off mouse click. Ive tried a few different things but cannot seem to achieve this. There doesn’t seem to be much similar in tutorials or the unity forums. If someone could point me on the right track or to something i may have missed on the forums it would be greatly appreciated. Thanks.
If I correctly understand your question, your only need is to change the camera transform.
1- add a collider to your object
2- in your object's script add the following function
void OnMouseDown() {
Camera.main.transform.position = otherobject.transform.position + cameraoffsetvector;
}
cameraoffsetvector is a vector which displaces your camera into its viewport position (otherwise it’ll just cohincide with otherobject’s transform)