I noticed that there has been some request for a Zelda style camera movement. My thought was I know it is somewhere out there, but no. Lol
I made a simple base camera control for people to build off of. The scripts are far from perfect, but they do the job.

Here is the project files!
Download
For those that want just the code:
Attach this to your colliders and change the X and Y to your layout. Should you get a bug or the camera is bouncing between colliders, adjust the colliders so they do not interfere with the player’s movement.
using UnityEngine;
using System.Collections;
public class CameraMovement : MonoBehaviour
{
public Transform cam;
public float posX = 0;
public float posY = 0;
void OnTriggerEnter(Collider col)
{
if(col.tag == "Player")
{
Camera.main.transform.Translate(posX, posY, 0);
}
}
}
Attach this one to your doorways or caves. For this code to work you will need to know where the X, Y and Z positions of your camera and doorways/caves. Otherwise the camera will default to 0,0,0 and or send the player into an infinite loop between doorways/caves. you will need to set your player just outside the doorways/caves to remedy the looping.
using UnityEngine;
using System.Collections;
public class MoveToArea : MonoBehaviour
{
public Transform cam;
public float posX = 0;
public float posY = 0;
public float posZ = 0;
public float camposX = 0;
public float camposY = 0;
public float camposZ = 0;
void OnTriggerEnter(Collider col)
{
if(col.tag == "Player")
{
col.transform.position = new Vector3(posX, posY, posZ);
Camera.main.transform.position = new Vector3(camposX, camposY, camposZ);
}
}
}
You may use this for whatever you like both commercial and non. Some credit would be nice.
Enjoy!
Starmind
