Spawned Character from Spawned Actor now working

I have an actor called “World” that spawns characters called “EnemyChaser” which chases the Player.
When I put an Enemy into mt level, it chases the player, as expected.
When I put the World script into my level, it spawns Enemies that chases the player, as expected.
The thing is, when I put the World class to be spawned, the spawned Enemies from this World doens’t chase the player.
Here are the blueprints:
Enemy Blueprint
image
World Blueprint


Game Mode

The Enemies variabe inside World is an array of Enemy class to be spawned (but for now there is only one enemy)
The Worlds variable inside Game Mode is an array of World class to be spawned (but for now there is only one world)

I am new to Unreal, but I can’t make any sense of this problem, so I need help.

I think, for some reason, the AI doesn’t see your player as the player pawn.

Might be worth debugging around that area with print string etc.

1 Like

That does not seem to be the case, sadly.
I’ve tried this:


And the output was changing accordingly to the player movement.
And this:

But still the AI did not move.

1 Like

I don’t use ‘move to’, but I suspect it’s not good on tick? I mean, you need to trigger it, and when it completes, trigger it again, no?

Also make sure that in your enemy blueprint, “Auto Possess AI” is set to "Placed in World or Spawned:

image

Yes, I saw it on some other discussion, but it didn’t fix the issue.

I don’t know about if it’s good or not, I just followed what I found online.
But I think the move to needs to be called every second, but what would you do instead? Perhaps it solves the problem.

moveto doesnt need and shouldnt be on tick,
you’d call it on event when for instance your target or location changes

otherwise we’d need more info, is the moveto failing? is the target invalid etc

Moveto, and when the success pin triggers, call it again :slight_smile:

Use [ " ] button to debug your AI at runtime.

Make sure that AI has a controller.

And press [ Num 0 ] to view the nav mesh. AI shouldn’t be in the middle of nav mesh hole.

It seems like the navmesh doesn’t undestand the mesh that is spawned as a walkable path.
I set the navigation mesh to Generate Dinamically and now is weidly working. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.