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

**URL:** <https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333>\
**Category:** Programming & Scripting\
**Tags:** spawn, actor, unreal-engine, pawn, question\
**Created:** [October 27, 2024, 8:30pm UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333 "2024-10-27T20:30:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![davi1521](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davi1521](https://forums.unrealengine.com/u/davi1521)\
**Post date:** [October 27, 2024, 8:30pm UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333/1 "2024-10-27T20:30:02Z")

</div>

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.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/9/989c81362834fcdcf501b80130b614fa44b85456.png)

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?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 28, 2024, 9:21am UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333/2 "2024-10-28T09:21:28Z")

</div>

The first error means that you’re attempting to access an actor that has already been deleted, but is still in the garbage queue.

The second means the actor is not valid. You could get that if something is the garbage for long enough. Or, it never was a valid actor ( the reference was not assigned ).

---

<div class="post-metadata">

**Author:** ![davi1521](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davi1521](https://forums.unrealengine.com/u/davi1521)\
**Post date:** [October 28, 2024, 1:14pm UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333/3 "2024-10-28T13:14:25Z")

</div>

Yeah, I understand that. What I don’t understand is why it’s not valid. I’m literally spawning it immediately before I try to set this variable; what is causing it to get deleted right away?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 28, 2024, 2:01pm UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333/4 "2024-10-28T14:01:08Z")

</div>

I can’t see the call, can you show that?

---

<div class="post-metadata">

**Author:** ![davi1521](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davi1521](https://forums.unrealengine.com/u/davi1521)\
**Post date:** [October 28, 2024, 2:48pm UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333/5 "2024-10-28T14:48:27Z")

</div>

In the screenshot above. Spawn actor, third to last node in the sequence.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 29, 2024, 7:30am UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333/6 "2024-10-29T07:30:32Z")

</div>

Ok, assumed it was elsewhere also… 🙂

Are the characters appearing?

Have you tried changing the spawn collision to ‘always spawn’?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/a/b5aeedd4d740fd9ff5df2fd6fc51238c03632492.png)

---

<div class="post-metadata">

**Author:** ![davi1521](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davi1521](https://forums.unrealengine.com/u/davi1521)\
**Post date:** [October 29, 2024, 1:39pm UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333/7 "2024-10-29T13:39:06Z")

</div>

No the characters don’t appear.

Always spawn fixed it. Just weird that they spawned in fine as actors with the same settings but not as pawns.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [November 28, 2024, 1:40pm UTC](https://forums.unrealengine.com/t/is-there-something-special-i-have-to-do-when-i-spawn-a-pawn-versus-an-actor/2091333/8 "2024-11-28T13:40:05Z")

</div>

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