Set Niagara Actor Parameter from Blueprints

I created a Beam Particle System as described in Niagara Beam tutorial (How to Create a Beam Effect in Niagara for Unreal Engine | Unreal Engine 5.0 Documentation)

Now I’m trying to spawn it on an actor and connect the end of the beam to an actor from blueprints and it spawns but I cannot set the parameter for the beam end, it connects to the default world location.
I’ve also tried to expose the Default Beam value as a user defined vector parameter and set it in a Blueprint from a pawn location, that didn’t work either.

Niagara Beam Emitter Setup

Pawn Blueprint

I seem to recall this was handy…

3 Likes

Thanks but nope, doesn’t work for me.

In what sense?

  1. You don’t like it?

  2. It’s just not relevant?

  3. It’s relevant, but doesn’t work?

  4. Something else…

Can’t set Niagara Parameter Value at runtime from a Blueprint. I can do it in in component settings inside the blueprint and it works, but not dynamically in runtime.

I should add, the screenshot shows that the component starts deactivated, I know that and successfully activate it in runtime, but can’t make to work the aforementioned.

1 Like

I can hardly find anything about niagara actor component parameters. Wouldn’t it be easier to read the actor info in the blueprint, and pass it as a vector to the system?

1 Like

It sounds like the parameter is being passed ok ( when you pass the vector ), but that you’re getting the parameter you want to set in the wrong way. Do you have code for that part you can show?

Hi there sorry to inject myself into this discussion. I face the same issue as @Prokul does with the same tutorial provided by epic games: How to Create a Beam Effect in Niagara for Unreal Engine | Unreal Engine 5.0 Documentation

I wonder if the the type of parameter has anything todo with that? Seems to be quite special.

I would follow another tutorial, frankly. If you’re both having a problem with it, it’s not a lot of use.

I just did another quick search. So there’s the tuut above and this

1 Like

thank you will check it out! appreciate it.

I think you need to make user parameters in niagara system(from beam emitter setup(click on drop down arrow of beam start/end and type “user” then click on “read from new user parameter”)). That will create the parameters. Then change values by setting vector parameters(of this niagara system) at runtime.

The tutorial by epic games is great as is the other. The used ‘Actor Component Interface’ type for the user variable which can be found in ‘NiagaraDataInterfaceActorComponent.h’ is not meant to be set at runtime. Since it is a UObject you can not instantiate it from blueprint and it has set the ‘EditInlineNew’ attribute which means that its values can only be set during runtime.

I was curious if there is a way around updating the beam end on tick with this type of variable, since it does basically the same. Just encapsulated within the niagara effect.

So updating a vector parameter on tick it is :slight_smile:

Thanks for your help and your quick response.

I have same problem. I tried many ways but not work. As @ [ClockworkOcean] said, User.Beam_End mean system get actor vector (or Location of Actor) to create Beam_end point. You can check in Scratch Pad, it set Map Get node is Actor Component Interface and use other node Get Transform and convert to vector, that why you should change to Vector instead of Actor. When i changed this User parameter from Actor to Vector and use BP call it by Set Niagara Variable (Vector3), with copy reference from Niagara System, it work ^^ Thanks!!!

same problem. I give up passing actor. and pass the actor location instead(by vector3). And i have to update the location every tick :rofl:

I think I have figured it out. Here are the steps:

  1. Create a custom Dynamic Input local module to get the actor location. Pay attention to the input type – Actor Component Interface. I’ve also set up a default value if the input is not valid so that it’s still visible in the Niagara editor when I’m tweaking it.

  2. Create a User Parameter of type Object, not any other type! I’m calling it TargetActor. This is the parameter we will be setting at runtime.

  3. In the Beam Emitter Setup module, set Beam End to our custom module, and set Actor or Component Parameter to the User Parameter we created in step 2. Keep Source Mode as Default. Now everything is linked together.

  4. Finally, use UNiagaraComponent::SetNiagaraVariableObject() to set the TargetActor parameter at runtime. Both Actor and ActorComponent are valid parameters.
    image

Hope it helps. I’m using UE5.1 btw.

6 Likes

Does it work with mesh and spirite render for moving from emitter location to defined actor location in world ?

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