Newer
Older
Dreamsturbia-Project-IADE-Unity3D / Assets / LookAtPlayer.cs
@Rackday Rackday on 21 Aug 408 bytes Project Added
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LookAtPlayer : MonoBehaviour
{
    private GameObject player;
    void Start()
    {
        player = Camera.main.gameObject;
    }

    // Update is called once per frame
    void Update()
    {
        transform.LookAt(player.transform.position + (transform.position - player.transform.position) * 1.2f);
    }
}