Eonirr

Untitled

Apr 23rd, 2025
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. Vector2 direction = (collision.transform.position - transform.position).normalized;
  2.  
  3. RaycastHit2D hit = Physics2D.Raycast(transform.position, direction, 1000, ennemyLayer);
  4.  
  5. Debug.DrawRay(transform.position, direction * 1000, Color.blue);
  6.  
  7. if (hit)
Advertisement
Add Comment
Please, Sign In to add comment