# Can't spawn my weapon

**URL:** <https://forums.unrealengine.com/t/cant-spawn-my-weapon/14700>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [November 5, 2014, 7:30pm UTC](https://forums.unrealengine.com/t/cant-spawn-my-weapon/14700 "2014-11-05T19:30:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whammy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Whammy](https://forums.unrealengine.com/u/Whammy)\
**Post date:** [November 5, 2014, 7:30pm UTC](https://forums.unrealengine.com/t/cant-spawn-my-weapon/14700/1 "2014-11-05T19:30:24Z")

</div>

I’m having trouble spawning a weapon. I copied the code from the ShooterGame, but I’m getting a NULL back for the pointer to the new actor.

```auto

	FActorSpawnParameters SpawnInfo;	
	SpawnInfo.bNoCollisionFail = true;
	AMyWeapon* NewWeapon = GetWorld()->SpawnActor<AMyWeapon>(AMyWeapon::StaticClass(), SpawnInfo);

```

The weapon class is defined and compiles without errors. What am I missing?
