Hi…
I’m kinda converting this laser script to a vertical orientation and according to my debug line drawing its going in the direction i want it to go, but this script was for a 2D side scroller and my game is a vertical 3D affair, but nothing is firing, perhaps my alien-invader prefabs need a 2D box collider instead of their normal box collider?
So the snippet below is obviously snagging me some where, no errors at all, I’m just speaking the wrong language perhaps
RaycastHit2D hit = Physics2D.Raycast (transform.position, new Vector3 (middle.transform.position.x, middle.transform.position.y + 4f, middle.transform.position.z), 9); // layer '9' is enemies layer
Debug.DrawLine (transform.position, new Vector3 (middle.transform.position.x, middle.transform.position.y + 4f, middle.transform.position.z));
if (hit.collider != null) {
please advise me, thank you