Texn0krat
(Texn0krat)
November 13, 2023, 8:33pm
1
Hello. I’m trying to make npc which can chase player. I created npc blueprint with perception and when I’m just drag it to scene it chase the player without problems:
But when I’m trying to spawn it in other bp with this script:
the NPC just standing in one place. I’ve tried to debut it and the only thing I know there is no controller in this bp:
Why is it happening?
1 Like
Leomerya12
(Leomerya12)
November 13, 2023, 9:10pm
2
Hello!
So I’ve never, personally, used the SPAWN_NPC function.
Just to make sure that it is firing correctly, attach a PRINT_STRING node to “Is_Not_Valid”.
If the string does NOT print, then attach it to the SPAWN_ACTOR output pin.
Come back with your findings.
Texn0krat
(Texn0krat)
November 13, 2023, 9:13pm
3
Just checked it - the variable is valid.
The string isn’t firing after spawn actor too. Strange…
Leomerya12
(Leomerya12)
November 13, 2023, 9:15pm
4
Just to be VERY CLEAR, the “Is_Not_Valid” PRINT_STRING attachment did NOT fire, yes? Nothing appeared on-screen?
Everynone
(Everynone)
November 14, 2023, 9:56am
6
Just like in the other thread, the other day, this seems to be the clue:
By default, characters are only possessed by an AI Controller when Placed in World
:
Adjust it to one of the highlighted options since you’re spawning them dynamically. Alternatively, you can do this in the NPC instead:
You will also need a navmesh for the AI to run around on, ofc. Once the above is set up:
2 Likes
Texn0krat
(Texn0krat)
November 14, 2023, 6:10pm
7
Yes, now it fixed. Thank you!
1 Like
system
(system)
Closed
December 14, 2023, 6:10pm
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.