LegitTeddyBears

ZCopyCat

May 26th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class ZRotationCopycat : MonoBehaviour
  6. {
  7.     [SerializeField]
  8.     Transform target;
  9.  
  10.     void Update()
  11.     {
  12.         var angles = transform.eulerAngles;
  13.         angles.z = target.eulerAngles.z;
  14.         transform.eulerAngles = angles;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment