How can i make a hiding system with my monster ai?

Hello! I have a monster ai for a game thats inspired by/a fangame for Dandy’s World. I want to create a monster ai similar to the one they have in game! Most of it is done, but I’m not sure how to recreate the hiding system.

Here is what i have

Here is what I’m going for

Any tips? I can post script if needed

There might be better ways but I believe you can just raycast. If you ray cast from the monster’s head to the player’s head and the ray doesn’t hit the player then they’re hiding. I would factor in distance and the dot product of the player and monster to make this better too

1 Like

Thanks a bunch dude! This really helped me a lot!!!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.