Is there something special I have to do when I spawn a pawn versus an actor?

davi1521
Sun, 27 Oct 2024 20:30:02 +0000
Programming & Scripting

I recently decided I had to change the class of my NPCs and creatures in my project into pawns versus actors so that I can give them AI.

But now I’m running into an issue with spawning them.

I have an actor in the level (well, pawn now) that spawns them at run time. At least it’s supposed to.

This was working just fine when they were actors. But now I get these errors:

Blueprint Runtime Error: "Attempted to access BP_TestCharacter2_C_0 via property K2Node_DynamicCast_AsBP_Creature, but BP_TestCharacter2_C_0 is not valid (pending kill or garbage)". Node: Set CreatureHitPointsCurrent Graph: EventGraph Function: Execute Ubergraph BP Level Manager Blueprint: BP_LevelManager

Blueprint Runtime Error: "Attempted to assign to None". Node: Set CreatureHitPointsCurrent Graph: EventGraph Function: Execute Ubergraph BP Level Manager Blueprint: BP_LevelManager

So, is there something else that the pawns need to spawn? Otherwise, is it possible to give them AI and have them be actors somehow?

8 posts - 3 participants