Abdula_2314124

Untitled

Nov 5th, 2022
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class EyeMove : MonoBehaviour
  6. {
  7.     public Transform Aim;
  8.  
  9.     void Update()
  10.     {
  11.         Vector3 pos = Aim.position - transform.position;
  12.         Vector3 newPos = new Vector3(0f, pos.y, 0f);
  13.         transform.rotation = Quaternion.LookRotation(newPos);
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment