I am making Bubble Blast kind of game in 2D in which i want to check the bubbles above the any bubble.
Ray cast will do the thing but i don’t know how to use it in Directions “NE” and “NW”. Can anyone help me to solve this problem?
N:
Physics2D.Raycast(bubblePosition, new Vector2(0,1));
NE:
Physics2D.Raycast(bubblePosition, new Vector2(1,1));
E:
Physics2D.Raycast(bubblePosition, new Vector2(1,0));
SE:
Physics2D.Raycast(bubblePosition, new Vector2(1,-1));
S:
Physics2D.Raycast(bubblePosition, new Vector2(0,-1));
SW:
Physics2D.Raycast(bubblePosition, new Vector2(-1,-1));
W:
Physics2D.Raycast(bubblePosition, new Vector2(-1,0));
NW:
Physics2D.Raycast(bubblePosition, new Vector2(-1,1));