Scripting problem

Hello,

I’ve got a problem with my script. I want my camera to follow my player (CubeObject) and look at it.

but it keeps saying : Assets/Camera_Position.cs(12,60): error CS0119: Expression denotes a type', where a variable’, value' or method group’ was expected

using UnityEngine;
using System.Collections;

public class Camera_Position : MonoBehaviour
{
	public Transform CubeObject;
	public int Distance = 3;
	public int Lift = 2;
	
	void Update () 
	{
		transform.position = CubeObject.position + Vector3(0, Lift, Distance);
		transform.LookAt(CubeObject);
	}
}

Does someone know how I can fix this error?

Hmm…not sure

Have you considered parenting the Player to the Camera? This way, it’ll always follow the player.

Mhhhh, didn’t think of that.

But I watched a tutorial on youtube.
http://youtu.be/m8VPHAs0F8w

I did almost the same, but I used C#

hope it helps, didnt test it

using UnityEngine;
using System.Collections;

public class Camera_Position : MonoBehaviour
{
	public Transform CubeObject;
	public float Distance = 3;
	public float Lift = 2;
	
	void Update () 
	{
		Vector3 vec=new Vector3(0.0f, Lift, Distance);
		transform.position = CubeObject.position + vec;
		transform.LookAt(CubeObject);
	}
}
transform.position = CubeObject.position + new Vector3(0, Lift, Distance);

Thanks a lot.