# Some Soft Pointer Asset Invalid

**URL:** <https://forums.unrealengine.com/t/some-soft-pointer-asset-invalid/2093488>\
**Category:** C++\
**Tags:** unreal-engine, pointer, CPP, question\
**Created:** [October 29, 2024, 4:19am UTC](https://forums.unrealengine.com/t/some-soft-pointer-asset-invalid/2093488 "2024-10-29T04:19:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ImAGoodSpoon1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imagoodspoon1/32/757809_2.png) [@ImAGoodSpoon1](https://forums.unrealengine.com/u/ImAGoodSpoon1)\
**Post date:** [October 29, 2024, 4:19am UTC](https://forums.unrealengine.com/t/some-soft-pointer-asset-invalid/2093488/1 "2024-10-29T04:19:09Z")

</div>

Hello there, I have a problem where my Soft Pointer is invalid. However, this isn’t happening to all of the assets. There are some assets that invalid if I check the validity of the Soft Pointer:

```auto
if (!WeaponTrailTemplate.IsValid())
{
	return;
}

```

This is happening on Packaged game and Standalone game.  
All of the invalid assets are already cooked properly (I already check on the .pak file and they are there). If I use Hard Reference, that invalid asset is loaded and worked.

I’m confused about what is the trouble, since only some of them are invalid, I think the problem isn’t with my code.

This is WeaponTrailTemplate by the way:

```auto
UPROPERTY(Transient, EditAnywhere, Category = "Components")
TSoftObjectPtr<UParticleSystem> WeaponTrailTemplate;

```

I initialize it from Blueprint so the path should be handled automatically (I log the path and it’s correct) but still invalid.

Do you have any idea about this? Thanks!

Here is the code:

```auto
void AWeapon::LoadWeaponTrail()
{
	if (!WeaponTrailTemplate.IsValid())
	{
		return;
	}

	WeaponTrailHandle = UAssetManager::GetStreamableManager().RequestAsyncLoad(WeaponTrailTemplate.ToSoftObjectPath(),
		[this]() 
		{
			if (WeaponTrail)
			{
				if (IsValid(WeaponTrailTemplate.Get()))
				{
					WeaponTrail->SetTemplate(WeaponTrailTemplate.Get());
					WeaponTrail->SetFloatParameter(TrailLifetimeParam, TrailLifetime);
				}
			}

			if (WeaponTrailHandle->IsActive())
			{
				WeaponTrailHandle->CancelHandle();
			}
		});
}

```

---

<div class="post-metadata">

**Author:** ![FrantisekSumsala](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FrantisekSumsala](https://forums.unrealengine.com/u/FrantisekSumsala)\
**Post date:** [October 29, 2024, 12:53pm UTC](https://forums.unrealengine.com/t/some-soft-pointer-asset-invalid/2093488/2 "2024-10-29T12:53:53Z")

</div>

This is an issue of the soft pointer API being a bit confusing. IsValid() checks whether the asset referenced by the soft pointer is loaded but for some reason Epic named it this way instead of something like IsLoaded(). If you want to check whether the soft pointer correctly references an asset, use IsNull().

---

<div class="post-metadata">

**Author:** ![ImAGoodSpoon1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imagoodspoon1/32/757809_2.png) [@ImAGoodSpoon1](https://forums.unrealengine.com/u/ImAGoodSpoon1)\
**Post date:** [October 31, 2024, 3:43am UTC](https://forums.unrealengine.com/t/some-soft-pointer-asset-invalid/2093488/3 "2024-10-31T03:43:59Z")

</div>

I see, thank you very much! with this information I can track the problem better!

---

<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 30, 2024, 3:44am UTC](https://forums.unrealengine.com/t/some-soft-pointer-asset-invalid/2093488/4 "2024-11-30T03:44:09Z")

</div>

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