How to move camera position to object position?

Hi guys, I’m new here and I’m stuck on my project. My problem is I want my camera(isometric view) to go in player position(character) so my view of my camera will be first person view amd I don’t know how can i move the camera position to player position. I only put this code.

public class NewBehaviourScript : MonoBehaviour
{
public Transform camera;
public Transform player;

void Start()
{

}

void Update()
{
if (Input.GetKeyDown(KeyCode.Tab))
{
camera.position = player.position;
}
}
}

I really don’t know how can i move the camera position to my character position…

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

Camera stuff is pretty tricky… it might be best to use Cinemachine from the Unity Package Manager.

There are tons of tutorials on how to set up either a basic camera or a Cinemachine camera to do precisely what you seek. Go start with Youtube.

1 Like