Finally found the big bug that had been making the player detection nonfunctional.
After all this time, it was just because I had accidentally put "if(gameManager.U_player.transform.position == tile.transform.position" instead of "if(GameManager.U_player.transform.position.x == tile.transform.position.x)"
For clarification, the former will NEVER be true, as the player's Y-position is set to be 1.5f higher than that of the tiles.
I've also made an alternative function for dark environments, narrowing down the field of view of the NPC to a single line.
I've also started work on the NPC attack pattern
Inga kommentarer:
Skicka en kommentar