Hello again,
I'm current learning how to implement various complexities of AI into my games, and as such I want to understand FOV and FOV interactions, I've created a basic state machine that switches between an Idling, chasing, and firing state (with a fourth "searching" state too act as a bridge in case the player steps just out of range).
Now, the game is top-down and completely bare-bones atm, just a grey background, and the player + AI scenes dropped on it. Here's what I want it to do: While idling, patrol in a continuous circle, looking for hostiles withing a limited cone of view that correlates to the front of the sprite, if a player is detected go to chasing While chasing, rotate smoothly and move toward the player until the player is in range. Once the player is in range, switch to fire. While firing, shoot a projectile from the sprites gun barrel that collides with the player, if the player escapes, go to chasing, if the player escapes that go to searching. while searching, continue traveling in the last known direction with a wider FOV then go back to idling.
And here is what I've done so far: Transition logic A radius detector The bullet and movement system (turned off for testing purposes)
My question then is, how do I go about creating a dynamic FOV that I can rotate with the AI? (i found one alternative on the asset store but it seemed to be quite bulky and confusing to understand).
ill supply the code in the following post if it's needed.