I’ve been using UE4 for a couple of days and starting to get into the AI features. I’m trying to write an AI blueprint class which makes an enemy chase the hero character for X seconds, then return to a specific point (In my case it’s a door, which is an actor.)
I’ve figured out how to make AI follow me, and I’ve been able to use timers to get them to stop chasing me, but I can’t figure out how to get them to go a specific actor or location? I never have the option to choose the door actor, or a target location, as the target for the enemies AImoveto.
I appreciate any help!
If you just want to get a reference to a static mesh actor in the level, then click on the said door actor, then directly open your level blueprint without clicking on any other asset in the level. Once in the level editor blueprint, right click on it’s event graph and you’ll get the option in the dropdown ‘Create a reference to selected actor’. Just select it and you’ll have a reference variable to your door actor in the level blueprint. At Begin play of the level blueprint, you can get this reference and store it in a class your AI can always access, like say your game mode.
But if you want more flexibility I suggest using a custom blueprint class for your door actor or a target point, that you can find at any point during the gameplay from blueprints [unlike a random static mesh actor]. At event begin play, you could use ‘Get all actors of class’ to get this actor and store a reference in your AI character or common accessible classes like Game mode.
Very clear and concise answer. Much appreciated! Hope I can get it to work.