Ive been working on a project where the Hunter of HunterActor spawns in and scans the area for an apple from the AppleActor. The scanning works but for some reason my AI MoveTo doesnt
I wish to make the pawn Hunter go towards the Apple and collide with it. (Yes, I have put navmesh around the area for the AI to work)
Heres a picture of the AI MoveTo blueprint in the level blueprint:
well then find a way to keep track of them. if you spawn them at runtime create a list variable or similar and add them there. or, if you add them manually inside the scene then create a public list and drag the scene actors in that list so you know about them in the scene
If the hunter spawns, I assume you use “spawn actor from class”?
Because from there you can possess the pawn (either player controller or ai controller) and set the variable to the possessed pawn. From there on, you can use the variable
I dont think this would be necessary since I am checking if a certain hunter detected a certain apple. I do sort of have a list where I know where every hunter spawns in coords but I dont really know how creating a list would detect these kind of things
casting is a heavy operation, doing it on tick in the level blueprint is not good. Since the hunter is the actor that will see the apple and then move, he can trigger the movement himself.
try this, when he sees an actor he checks if it has an apple Tag. if thats true the hunter gets the controller thats controlling him and triggers the movement to the seen actor, now that he confirmed its actually an apple.
if you are using AI unreal has all sort of specialized components that are made to be used to detect stuff in the level.
so if you have a hunter that needs to detect an apple and then you need to know about it i think this can be done using the AI tools as those are made to avoid writing repeating tasks to check every frame if an apple was found or not.
Well I figured out how to get information of the apple but now the apple needs to be hunted by the Hunter. Ive found out that the AI MoveTo cant make the Hunter move.
I assume its something to do with the pawn itself or that it doesnt get the controller but idk
for the MoveTo to work you need a character. Like the standard character that is included when you create a third person project. It has all the components required by the AI to move the character. Also you need navigation data in the level