ai move to on command

i want the player to walk into a room and see the ai enemy standing in like a corner or something and when the player goes out of the room and hits a trigger box the ai will start following the player but i keep getting errors and my castings always fail.

the player would walk into the room and exits from the same place they entered so there is a trigger box inside the room that will spawn the trigger box that runs the ai outside the room.

Hey there @DiploQuin! Welcome to the community!

I’ll give some general tips, but if you can show us your blueprint and explain your use case we can probably correct it right then and there!

My first thought was, where are you casting and to what? If you’re having trouble with casting to the player, (and there’s only one) the easy way is to use Get Player Pawn and you don’t need to cast to get it’s actor details.

However if you’re trying to cast to the AI to tell it when to start chasing and when to stop chasing it’s somewhat more dependent on how your game is set up. You need to get a reference to that AI actor before you can cast to it, and from your description you might be doing room based horror so you could get away with assigning that reference when the AI is spawned.

1 Like

sorry for not answering, but believe it or not i just saw this reply like 5 hours ago and had this crazy feeling to make the ai system work, so i decided to work on it and what do you,

IT WORKED!

isn’t it crazy

here’s how i did it
.
.
.

i already forgot how it works, but here’s some spaghetti




1 Like