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.
-
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.
-
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.
Hope it helps. I’m using UE5.1 btw.