What I did was make the Camera a child to the cube(just a simple drag and drop of the camera into the cube). But the problem is that the camera follows the cube on a fixed position while keeping its focus on where it started filming. I want the camera to follow the cube completely(focus/background). How do I do that? its a 2d game and its in c#.
Please help.
After making the camera a child of the cube, you can then arrange the camera the way you want it in the Scene View (looking at the cube, positioned at the correct distance, etc.). After arranging the camera correctly as a child of the cube, it should always follow the cube and also look at it, if that is what you desire.
Thanks for helping but I found out how to fix it. I attached this script to the camera then attached the Player cube to the player game object.
public float LockedY = 0;
public float LockedZ = 0;
public GameObject player;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.position = new Vector3(player.transform.position.x, LockedY, LockedZ);
}