I've encountered a weird issue where Physics2D.LinecastAll stops working when I actually build the game.
I use a linecast to check if an enemy has reached a wall, if it has, it will turn around and patrol the opposite direction. I also use a linecast to detect if the player is close enough to an enemy to perform a melee takedown.
Both of these linecast checks work when the game is running in the inspector. But once I build the game, the enemy ai will run straight into the wall, and the player is unable to perform a melee takedown. Meaning, the linecasts are not working.
Does anyone know how to fix this issue?
↧