Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class EnemyView : MonoBehaviour
- {
- private void Update()
- {
- RaycastHit2D hit = Physics2D.Raycast(transform.position, transform.up);
- Debug.DrawRay(transform.position, transform.up * 10, Color.red);
- if (hit)
- {
- Debug.Log("Spotted!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement