# TSubclassOf and TSoftClassPtr parameters becomes empty on rebuild project

**URL:** <https://forums.unrealengine.com/t/tsubclassof-and-tsoftclassptr-parameters-becomes-empty-on-rebuild-project/436884>\
**Category:** Pipeline & Plugins\
**Tags:** tsubclassof, unreal-engine, bug-report, Visual-Studio, CPP, question\
**Created:** [November 2, 2018, 9:15am UTC](https://forums.unrealengine.com/t/tsubclassof-and-tsoftclassptr-parameters-becomes-empty-on-rebuild-project/436884 "2018-11-02T09:15:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yarpoplar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yarpoplar](https://forums.unrealengine.com/u/yarpoplar)\
**Post date:** [November 2, 2018, 9:15am UTC](https://forums.unrealengine.com/t/tsubclassof-and-tsoftclassptr-parameters-becomes-empty-on-rebuild-project/436884/1 "2018-11-02T09:15:46Z")

</div>

Good day!

I’ve created custom UStaticMeshComponent called UGunComponent and there I have this:

```
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TSoftClassPtr <class ABaseProjectile> ProjectileType;

```

I’m using this variable for spawning ABaseProjectile’s. In blueprint editor I’m assigning to this variable desired ABaseProjectile and everything works fine. But when I’m trying to rebuild visual studio project - that variable becomes empty, like it was never assigned!

I tried use TSubclassOf but achieve same results. Maybe I’ve missed something?

---

<div class="post-metadata">

**Author:** ![yarpoplar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yarpoplar](https://forums.unrealengine.com/u/yarpoplar)\
**Post date:** [November 2, 2018, 9:29am UTC](https://forums.unrealengine.com/t/tsubclassof-and-tsoftclassptr-parameters-becomes-empty-on-rebuild-project/436884/2 "2018-11-02T09:29:15Z")

</div>

I noticed that it’s applies only to UStaticMeshComponent. I created this variable in my custom APawn class and everything works fine, variables are stored after rebuild as it supposed to be.  
What’s wrong with UStaticMeshComponent?

---

<div class="post-metadata">

**Author:** ![yarpoplar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@yarpoplar](https://forums.unrealengine.com/u/yarpoplar)\
**Post date:** [November 2, 2018, 9:48am UTC](https://forums.unrealengine.com/t/tsubclassof-and-tsoftclassptr-parameters-becomes-empty-on-rebuild-project/436884/3 "2018-11-02T09:48:40Z")

</div>

Don’t know how, but I managed to fix it. I just removed my component and added it again. Why this is happens and what to do to not meet this bug again?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [November 2, 2018, 4:06pm UTC](https://forums.unrealengine.com/t/tsubclassof-and-tsoftclassptr-parameters-becomes-empty-on-rebuild-project/436884/4 "2018-11-02T16:06:09Z")

</div>

you hoy reloading when this occures?
