Hello, developers.
Now, I have trouble with detecting enemy.
Most of coders use Raycast when they need something to detect specific thing.
But raycasting is not quite good, I think.
For example,
void ExampleCode()
{
...
RaycastHit hit;
if(Physics.Raycast(player.position, player.forward, out hit, 15))
if(hit.transform.tag == "Enemy")
Debug.Log("It's Enemy!");
...
}
In this case, it is perfect what I wanted.
But, what if in this case?
Then we should plus the code like player.back
But what if enemy is coming from 7’o clock?
So, ultimately, I want to make player detect enemy in specific area like this.
Is it possible with Raycast? or other ways? Thanks for reading.