Oh. I’m not sure about that loop in BeginPlay. Looping like that is confusing so I try to avoid it. It may work fine for all I know but how about we get you set up with a timer that ticks off once per second and does the spawn? Once I feel comfortable about that then I can look deeper. Or maybe someone else can verify that it’s fine.
To use a timer, you want to add a custom event, call it SpawnNewAI (or whatever you want). Then from BeginPlay, you want to use SetTimerByEvent, giving it the time period and setting Looping to true. Then connect the Event pin to your custom event.
Now, from your custom event, you can run your spawn code and it will happen once per whatever time period you gave it.
That will do what your loop is doing but it will do it in a better way.
OK I see the issue. When you call Spawn, it runs BeginPlay in the AI pawn before TargetPositionEnd is set. What you want to do is go into the AI pawn and make TargetPositionEnd public and set “ExposeOnSpawn” to true. Then refresh the spawn node (right click menu). TargetPositionEnd will show up in the spawn node. Plug the end location into that and you should be good.
I have do what you suggest me but i don’t understand your last reply. I have set TargetPositionEnd to “ExposeOnSpawn” and i think that it is public because private is not ticked… But The AI stillnot moving
Get rid of the SetTargetPositionEnd node. You don’t need that. If you set up Expose on Spawn correctly then click the down-arrow in the Spawn node and see if the pin is there. That is what you want to plug the end-location into.