Component created in C++ not editable in BP

I have a class with a particle component.

The problem reside for editing the properties.

UCLASS(Abstract, Blueprintable)
class KSGM_API AKProjectile : public AActor
{
	GENERATED_UCLASS_BODY()
…...

protected:
…….
	/** The particle component */
	UPROPERTY(BlueprintReadWrite, Category=Projectile)
	class UParticleSystemComponent* ParticleComp;

When I set the var to BlueprintReadWrite, I cannot see the properties.

If I set the var to EditDefaultsOnly I can see the properties, but I cannot use the component in Blueprints.

	/** The particle component */
	UPROPERTY(EditDefaultsOnly, Category=Projectile)
	class UParticleSystemComponent* ParticleComp;

What type should I use to be able to edit the properties and access the component in Blueprints ?

And why the component in encapsulated in a Particle Comp.

I have another class and the properties are not encapsulated in a Particle Comp.

UCLASS(Abstract, Blueprintable)
class KSGM_API AKSpell : public AActor
{
	GENERATED_UCLASS_BODY()
…..

	UPROPERTY(VisibleDefaultsOnly, Category=Projectile)
	class UParticleSystemComponent* ParticleComp;

Txs for your help,
D.

you need EditAnywhere in uproperty meta as well. usually alongside with BlueprintReadWrite.
detail explanation of all access meta tags can be found here A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

1 Like

It doesn’t work.
I cannot see the properties

I’ve tried to delete the component from C++, recompile, launch the editor, compile the blueprint deriving from the C++ class, and save.

The I put back the component with another var name.

    	/** The particle component */
    	UPROPERTY(VisibleDefaultsOnly, Category=Projectile)
    	class UParticleSystemComponent* ParticleSysComp;

Now I can see the properties of the component

And I’ve added a function to access the component.

    	/** Get the is playing in reverse or not. */
    	UFUNCTION(BlueprintCallable, Category = "Projectile")
    	class UParticleSystemComponent* GetParticleSystemComponent() const;
1 Like

can you share you whole class code ?

The KProjectile class is the one that was causing the problem.

The KSpell owns almost the same type of components and was not causing the problem.

link text

I had the same problem and just changing the variable name in c++ and recompiling fixed it.

2 Likes

Thanks.
The problem disappears with the next version.
I cannot remember which version, since it was 3 years ago.

Actually I was having this issue in UE5.

this issue accures when you hot reload inside visual studio.

1 Like

When you compiling for the first time - Unreal remember UPROPERTY, so changing it later will not make effect. You need to rename component in C++, recreate blueprint or change parent class to something and then back to reinnit blueprint. I didn`t find good solution how to resolve this better without rebuilding blueprint manually but even this solution can help you

1 Like