Advertisement
KorolevDmitry123

Untitled

Jul 8th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class RotationFollower : MonoBehaviour
  5. {
  6. public GameObject target;
  7. public GameObject follower;
  8. public float rot;
  9. public float rotf;
  10. void Update()
  11. {
  12. //rot = target.transform.rotation.eulerAngles.y;
  13. //rotf = follower.transform.rotation.eulerAngles.x;
  14. //rotf += rot;
  15. var followerEulers = follower.transform.rotation.eulerAngles;
  16. followerEulers.y = target.transform.rotation.eulerAngles.y;
  17. follower.transform.rotation.eulerAngles = followerEulers;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement