Day #006

DAY #006

make an object always look at another

Main points covered

#lookat

C# script (attached to the object that will be looking at)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LookAt : MonoBehaviour {

public Transform myplayer;

void Update () {
transform.LookAt (myplayer);
}
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *