Spawn Actor is not moving when spawned

Hello, I’m trying to make a bush that spawns animals you can eat when you touch the bush. I’m using SpawnActor and placing the actor (currently just the gator but i’ll replace that eventually with an array of possible animals) in a spot near by the bush. My problem is when I touch the bush and the gator spawns he doesn’t move. I have 2 general AI and 2 Behavior trees, predators (which case you down) and prey (which runs away from you) I tried SpawnAI but then nothing spawned at all.
-BONUS POINTS, if you can tell me how to set up a possible range of how many animals to spawn when it does!

1 Like

Yeah there’s a navmesh. I solved the issue though, after SpawnActor, I needed to plug in “spawn default controller”
I guess spawn actor just spawns the skeletal mesh and then you have to spawn it’s “brain” with its controller

2 Likes

Hey buddy,

quick question.

is there a nav mesh in the scene?

you should probably run the animation on begin play inside the spawned actor as it may be an ordering issue, the play animation node may be called before the actor is spawned.

if you want to spawn a predetermined amount of animals you can use a for loop with an int plugged into it, just set the int with the amount of animals you want to spawn (remember that int is 0 indexed)

Can this be marked as resolved please :slight_smile:
@Didgeridrew5

Thanks for hinting the solution. This was driving me insane.

Thank you for this! It works. For anyone else wanting more detail, there’s a node called Spawn Default Controller, just do that out of the return value of SpawnActor and it should work!

All you need is to set “Auto Possess Ai” to “Placed in World or Spawned” and it will work.

6 Likes

/\ This fixed my issue!! :slight_smile:

This works thank you

at UE 5.2 , Spawn AIFrom Class Node

1 Like

Thank GOD! This answer help me so much

Thank you so much fainly l get the Solve، it works👏

Fixed my issue also… Thanks you

Thank you soo much