Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class EyeMove : MonoBehaviour
- {
- public Transform Aim;
- void Update()
- {
- Vector3 pos = Aim.position - transform.position;
- Vector3 newPos = new Vector3(0f, pos.y, 0f);
- transform.rotation = Quaternion.LookRotation(newPos);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment