Quantcast
Channel: Answers for "How to make a simple line of sight in a 2D top down shooter."
Browsing latest articles
Browse All 6 View Live

Answer by Cam Edwards

Rather than checking to see if the raycast hits the GameObject performing the cast, you could assign all objects you want to check to a certain layer and cast against that. To make that a bit clearer...

View Article



Answer by pako

It seems you are casting the ray backwards. I think that if you want to cast the ray towards the enemy you should use for the end point: finalDetected.transform.position - transform.position ...not the...

View Article

Answer by wibble82

Hi Zac A few bits here. First up,, as pointed out by pako, if what you want is a ray from the transform.position to finalDetected.transform.position, you have the maths the wrong way round. To...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images