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.
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.
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?
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?
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.
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!!!
I think I have figured it out. Here are the steps:
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.
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.
Finally, use UNiagaraComponent::SetNiagaraVariableObject() to set the TargetActor parameter at runtime. Both Actor and ActorComponent are valid parameters.