Advertisement
Guest User

Untitled

a guest
Mar 9th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class EnemyShooting : MonoBehaviour
  5. {
  6. public bool Angry;
  7. public GameObject Player;
  8. public float turnrate = 1f;
  9. public float bulletrate = 2f;
  10. public bool canseeplayer = false;
  11. public float angle = 10;
  12.  
  13. void Update ()
  14. {
  15. if (Angry) (canseeplayer);
  16. {
  17. transform.Rotate(Time.deltaTime, Player);
  18. transform.Rotate(Player, Time.deltaTime, Player, Space.World);
  19. }
  20. if ( Vector3.Angle(Player.transform.forward, transform.position - Player.transform.position) < angle)
  21. {
  22. canseeplayer = true;
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement