Enemy A.I help again

Ok so now that I have the monster chasing the player when seen, I need the monster to follow a pattern. Here is a example.


You see those X? Those are where he would stop and wiat for a bit and then go to another. How do I do this?

3 Likes

Ease maybe connected to position, and have a timer connected to the next ease position, I don’t really know I haven’t done that before

2 Likes

Um ok thanks. Iwill try it out.

1 Like

You could probably research stealth game guard’s AI, as it is similar to what you want

2 Likes

wait here on flowlab?

idk if there are any good stealth game examples on flowlab, i can check tho

Ok thanks! If you do it would mean alot. thank you!

JR has an example that does exactly what you’re looking for (It may not have the ability to wait at the points, but adding a single timer should fix that issue)

It’s the first one on the list

2 Likes

Ok thank you CodeAlpaca!

2 Likes

I’m gonna try to make a simple stealth example

  • Enemy walks in set patterns (I can’t figure out JR 01’s bundle lol)

  • Enemy sends out raycasts to make a viewcone

  • If ray collides with player and there’s nothing in between the enemy and player, instant game over

1 Like

Raycasts failed because they don’t rotate with the enemy

Ray casts can rotate because they have an Angle input. I would recommend looking at my Lighting example to see an efficient way to have all the ray casts

Summary: (Starting Value + Player Rotation) - FOV/2
I spawned in another object to have the ray casts because I could assign each of them a starting value without having to manually do it. (In the example the lines extend to match the ray cast length, this is unneeded for what you’re doing unless you wanted to have a visual of the enemies sight line)

1 Like

I’m going to take this to another help topic so we don’t clog this one up

2 Likes

this is a very simple baseline, maybe it will help you

make a topic for this, maybe other people would want to see it

1 Like

Thank you @nhgcr_for_the_3rd_time !

2 Likes