Hello guys. I’m working on a game where the camera movement is a bit inspired of the lego games. I want the camera to stay in on spot at different places, but it needs to look at the player. Down below is the code I’ve made for the camera so far. how do I use the direction to rotate the camera the way I want?
using UnityEngine;
using System.Collections;
public class cameraLook : MonoBehaviour {
movement movement;
public Transform Player;
// Use this for initialization
void Start () {
movement = FindObjectOfType<movement>();
}
// Update is called once per frame
void FixedUpdate () {
Vector3 displacementFromTarget = Player.position - transform.position;
Vector3 directionToTarget = displacementFromTarget.normalized;
}
}