0
\$\begingroup\$

In the level blueprint I made a code so that after 5 seconds an NPC was spawned, it happens that it does nothing.

Only the NPC I added by the level editor acts correctly.

Image of what happens:

enter image description here

Level Blueprint:

enter image description here

NPC Blueprint:

enter image description here

I did a search, because I imagine that to solve this is to just modify the event to some of the type: When created or when spawned.

Search:

enter image description here

I also thought of something like an event involving the collision between the NPC and the ground, but I considered it silly.

Link I found and at first I'm thinking that the solution may not be as simple as this:

https://answers.unrealengine.com/questions/204154/event-dispatcher-on-a-spawned-actor.html


EDIT 1 (Attempt based on ColdSteel's comment)

I added 2 impressions to see if the Event Begin Play was not even running:

enter image description here

The event is being started correctly and the loop is also:

enter image description here

But the NPC does not go towards the target points and I do not know the reason.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Thats interesting... for me the begin play works for dynamically spawned actors: forums.unrealengine.com/development-discussion/… \$\endgroup\$ May 25, 2019 at 3:04
  • \$\begingroup\$ To verify if the BeginPlay is called add a PrintText node as a first node. \$\endgroup\$ May 25, 2019 at 3:05
  • \$\begingroup\$ I added the print, it runs, but the rest of the code does not. \$\endgroup\$ May 25, 2019 at 21:59

1 Answer 1

0
\$\begingroup\$

Go to the NPC blueprint at the top of the screen, click Class Defaults, search for the Auto Possess AI option on the Pawn menu and select the Placed in World or Spawned option.

Image to facilitate:

enter image description here

I had help from user Grot13 (https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1624007-actor-does-not-perform-action-when-spawned).

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .