Niagara user parameter is not visible in BluePrint -> UE5.2 & C++

Niagara user parameter not visible in blueprint when using C++.

Everything is correct in a pure blueprint.

10

11

Niagara User Parameters does not appear if instantiated from C++.

12

Declaration:

14

implementation:

I can access it using C++ like this, and it works.

But from the blueprint I can’t edit it.

I am doing something wrong?
Is it something normal?
Or is it a bug?

Thank you so much!!

I have the same problem and there is no info about it. Looks like it’s a UE5.2 bug or something like that.
C++ component:
image1

BP component:

i think it is a bug too… work in C++… definily is better

Still occurring in UE5.4.2

UE 5.4.4 have the same problem

Have the same problem. UE 5.4.4

You need to use SetVariableFloat for 5.3 and above

NiagaraComponentComponent->SetVariableFloat(“WidthScale”, 5.0f);
1 Like

@Ivan3z

Give the niagara component the following uproperty and it should work

UPROPERTY(VisibleAnywhere, meta = (AllowPrivateAccess = true))
class UNiagaraComponent* NiagaraComponent;

Here it is in a custom c++ class :slight_smile:

Definition in c++ class header

And the custom user params in the particle system

And if I remove the float override I set in c++ then yes it does show the original 800 value bp => c++ class

1 Like

Thank you so much @3dRaven :heart:

Doesnt work for me :frowning:

I have the header defined:

UPROPERTY(VisibleAnywhere, meta = (AllowPrivateAccess = true))
class UNiagaraComponent* NiagaraComponent;

In cpp constructor I create with:

NiagaraComponent = CreateDefaultSubobject<UNiagaraComponent>(TEXT("MyNiagaraComponent"));
NiagaraComponent->SetupAttachment(RootComponent);

User Parameters doesnt expand:

For reference, the same system with a component declared in bp is:

@3dRaven What does your cpp look like in constructor


Here is a version with a linear color user param exposed

As you can see it’s working in 5.4

only thing in cpp instantiating the niagara comp is this

AGameCharacter::AGameCharacter()
{ 	
	PrimaryActorTick.bCanEverTick = true;
	// Create components
	Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
	NComponent = CreateDefaultSubobject<UNiagaraComponent>(TEXT("NComp"));
	SphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT("SC"));	 
	NComponent->AttachToComponent(SphereComponent, FAttachmentTransformRules::KeepRelativeTransform, FName("NiagaraComponent"));
}

The character test files that use the niagara component (just change the api)
GameCharacter.h (1.0 KB)
GameCharacter.cpp (1.3 KB)

Thanks @3dRaven - It is getting weirder… your GameCharacter doesnt work for me if I edit the default blueprint from the content browser… but it DOES work if I drag an instance of the blueprint into the scene!!! My other actor also works if dragged into the scene.

So the issue is you cant edit the User Parameter on a Niagara System Component created in c++ on the Blueprint class.

But you can edit edit the User Parameter on a Niagara System Component created in BP on the Blueprint class !

And you can edit the User Parameter on a Niagara System Component created in c++ on the Blueprint in the scene!

@3dRaven If possible, can you verify editing the component defaults in the blueprint class from the Content Browser doesnt work for you?

[edit] Even weirder, I can right-click copy the broken User Parameters and they are there. It looks like the drop-down arrow must be broken somehow when editing the class default version.

It works with no blueprint in the scene, it’s enough to create a bp based on the c++ class with the niagara component.

As you can see the class defaults pick up the custom niagara component’s parameters and can even be edited and remembered. (overwrote the yellow with a new color to test it, if I revert to default it returns to the particle’s yellow color)

Maybe some stale data cache is causing some problems? Try deleting the temp dirs and recompiling.

Its very strange - tried it in 5.4.4 and 5.5.1… Another developer discovered the issue on a different machine.

As a work around we can just use the c++ variable to point to the blueprint defined property.

:frowning:

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