Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class EnemyShooting : MonoBehaviour
- {
- public bool Angry;
- public GameObject Player;
- public float turnrate = 1f;
- public float bulletrate = 2f;
- public bool canseeplayer = false;
- public float angle = 10;
- void Update ()
- {
- if (Angry) (canseeplayer);
- {
- transform.Rotate(Time.deltaTime, Player);
- transform.Rotate(Player, Time.deltaTime, Player, Space.World);
- }
- if ( Vector3.Angle(Player.transform.forward, transform.position - Player.transform.position) < angle)
- {
- canseeplayer = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement