# Spawn actor error

**URL:** <https://forums.unrealengine.com/t/spawn-actor-error/465241>\
**Category:** Blueprint\
**Tags:** error, spawn, actor, expose-on-spawn, unreal-engine, question, CPP\
**Created:** [May 15, 2020, 5:55pm UTC](https://forums.unrealengine.com/t/spawn-actor-error/465241 "2020-05-15T17:55:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZorvexMaker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZorvexMaker](https://forums.unrealengine.com/u/ZorvexMaker)\
**Post date:** [May 15, 2020, 5:55pm UTC](https://forums.unrealengine.com/t/spawn-actor-error/465241/1 "2020-05-15T17:55:21Z")

</div>

Hi Everyone!

I’m getting an access violation reading location error when I try to spawn an actor. In my weapon class, I want to spawn a bullet actor. Bullet is a TSubclassof. The weapon is spawned on the BeginPlay of the character, and that work’s perfect. Any idea of what can this error be?

Spawn actor code:

> **[Gyazo](https://gyazo.com/ca7cd06890e6737f117d2ac003e59a06)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

Error:

> **[Gyazo](https://gyazo.com/4b4eca6d700d8a35d7398fa2fe2a403e)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

Thanks!

---

<div class="post-metadata">

**Author:** ![Bino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bino](https://forums.unrealengine.com/u/Bino)\
**Post date:** [May 15, 2020, 6:12pm UTC](https://forums.unrealengine.com/t/spawn-actor-error/465241/2 "2020-05-15T18:12:51Z")

</div>

Any chance of a callstack? With variable values? The crash message isn’t helpful.

How have you initialized BulletSpawnPoint? If you get rid of them and put a zeroed out vector and rotator does it still crash?

---

<div class="post-metadata">

**Author:** ![ZorvexMaker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZorvexMaker](https://forums.unrealengine.com/u/ZorvexMaker)\
**Post date:** [May 15, 2020, 7:48pm UTC](https://forums.unrealengine.com/t/spawn-actor-error/465241/3 "2020-05-15T19:48:59Z")

</div>

I zeroed the vector and the rotator and it still crashes. Bullet Spawn Points is initialized, it appears correctly on the actor blueprint. Bullet weapon is set on the blueprint actor. Not sure what else can be ☹  
Here is the info of BulletOfTheWeapon, hope it helps! Thanks a lot.

 ![301998-bullet.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/0/59048017208dbd9218c271e770470ea0e440893a.jpeg)

---

<div class="post-metadata">

**Author:** ![Bino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bino](https://forums.unrealengine.com/u/Bino)\
**Post date:** [May 16, 2020, 6:28pm UTC](https://forums.unrealengine.com/t/spawn-actor-error/465241/4 "2020-05-16T18:28:19Z")

</div>

That’s not quite the call stack but is very interesting… It appears you’re spawning a USTRUCT. I’ve never tried but I’m pretty sure SpawnActor isn’t for structs. Surprised that compiles and doubt it would work with a projectile movement component. Maybe I’m missing something.

Check out the spawning projectile tutorial and double check the bullet object.

> **[3 - Implementing Projectiles](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/CPPTutorials/FirstPersonShooter/3/)**
>
> How to implement projectiles for your First Person Shooter game.
