How to change Particle Trail in Anim Notify with Blueprint?

Can someone please help with pictures?

People have asked this for years, and this post doesnt explain enough for me to know what to do:

Details:

I have a Blueprint (Widget UMG code) that randomly pulls a Particle Variable from a Data Table. I want to pass this Particle Variable (name of particle to use) > to the Anim Notify Trail - of a Sword Animation, for any Sword used during that animation.

This particle is not in the Sword BP, it is only set as a Trail in the Anim Notify (which plays when the Player has a Sword – but I have a bool for that in the Character BP).

The Particle Variable comes from a Widget Blueprint code, and this Widget is a component in the Sword BP.

Thus every for sword that exists, in the Sword BP > I Cast To Widget > to pull its Variable > to change a Sword setting component on the sword. But the Widget and Sword BP are not in the Anim Notify, so I cant cast to them?


.

So the main question is how can I get the exact Widget of every Sword that is in the Level (held by Player, AI, or on the ground) – so that during the Play Anim Notify (when the Trail Particle displays = only when swung), so that I can Set this Particle to be used in the Anim Notify?

I.e. each sword is different, and I want to pass a unique Trail Particle to each sword (which plays when swung).

Mathew showed how we can make are own Anim Notify Trail (v2) BP – and edit the code, then select this as our Trail v2 in the Anim Notify.

[What are the nodes to use to Get from the Controlling SK mesh (since only character or AI can pickup the sword) > then Get the Widget of the Sword that is held > then I can Cast To Widget > pull its Particle Variable > set it as the Particle in this Anim Notify.]
.

.
Or if you know how to put my Particle (not Niagara) as a Component in the Sword BP. Then pass the Sword’s Particle to the Anim Notify Trail Particle? (I put the Particle in Anim Notify, because I need the Begin/End logic of the “Trail” Notifies - which seems to be code only in Anim Notifies.)

Im aware of BPI. But this did not work when I tried to use it to pass a Widget Variable to Sword BP. So if you understand how to pass a Widget Variable to Anim Notify Trail BP (modded), then please show pictures. Thank you :slight_smile:

@L1z4rD89 or anyone.

  1. What am I doing wrong with this BPI?


  2. Without a tutorial I am unclear what to set an Input and Output (at BPI creator window), or what to put as the Target (when using the BPI message Node)?
    .

  3. Do I need to use a ‘Set Variable node’ after a BPI message node? Or does BPI pass the Input variable > to whatever the Power Output Pin (white) is connected to?
    .

  4. Is Target = the Variable? Or are only “Inputs” variables (which I add at the BPI management window)? (Im unclear what to do when the Target is also the Variable that I want to pass)

  5. Why is this Variable read-only, when I made it and checked boxes?


    .
    .

@TheKaosSpectrum Why? 2020: were you speaking of an older version limitation?
Is it because C++ limitation, cant expose the variable in BP?
Why would Epic give us a selectable setting (Particle), yet not give us a way to change it live in Game using BP - when they know we want to Get/Set everything?

Without knowing your reason, it’s frustrating because Epic gave us a way to add the Override BP (our version of Trail Notify). But it’s not working as shown above. And Idk if there’s a hardcode restriction or if my nodes are wrong??? Please help, ty.

Erm, like this(?):

Press Play and test it. See if this is what you wanted and try to adjust it.

1 Like

Lol, thanks. You’re the best. I’ll give you credit in the thing I make if I finish it.
So you used the Cast To method instead of BPI. Mine would look like this.

  1. Is it correct that if I dont know if the Player is currently holding the exact “Sword 2 Pickup BP 4” (technically he should, if he was triggered to play this Animation) - that I can still try to cast to it (without Engine error), but include the Is Valid to stop the code if Player doesnt have it?

  2. Thanks for showing me how to use “Get Owner” to Cast to my Player (I forgot). But what do I also add instead of Cast to [MyCharacter] if the AI can also pick up this sword (and has a Sword BP component) to Cast to?

  3. Is there a wildcard Cast to [AI]? E.g. a way to Get Owner (mesh) > wildcard Cast to that [owner name] because I dont know who it will be?
    .

  4. In my first example pic with the BPI - have you determined that we cant use BPI in this weird Anim Notify override? Thanks for your time :slight_smile:

You don’t need the IsValid, because if it is not valid the cast will fail.

About the BPI:
Create a BlueprintInterface

Add it to the character or AI in the ClassSettings
image
image

Implement the event via double clicking it on the left side:
image

Connect your ParticleSystem:
image

Inside the BP_NotifyState change the function to this:

1 Like

Thank you show much for showing the steps with pictures to remind me. :slight_smile:

  • (Ive been working on this since last night - to put the random code in a Manager Actor instead of the Widget - as per your suggestion in the other thread. I havent finished yet, but i’ll ask you questions if it fails. So far I cannot Cast to the Widget in the Anim Notify Trail v 2. So I think I am forced to put the Name code in a Manager Actor.)
  1. Question: Can you confirm that I am choosing the correct Particle type, and subtype? (Technically your Particle is added as a ‘component Variable’ in your Character BP.)

For anyone else new to BPI - remember these steps.
(I first made a working BPI 5 months ago; but recently forgot step 2 when I made a new BPI: forgot to apply it to the Actors A & B > by adding it to their ClassSettings.)