How can I use a BP actor to play a widget animation in Level
It really depends on the circumstances. What is the trigger? Do we click something, run into something, time expires, something else?
You could use an event dispatcher:
But a much better question is: why would you ever want to do that? Why use widgets in the LB? You may have a great reason - simply asking as nothing comes to mind that could justify it.
No I am using Level BP I just want to call it after you run over an Actor BP
Is the actor BP in the level already? If so, select the actor and:
You have direct access to all persistent actors’ events.
I actually have a code with this, I want to access and call widget animations in ActorBP
Could you be more specific? This is all so vague. Could you describe the scenario?
Who calls whom, under what conditions? Where are the actors? Were they spawned dynamically? Who is supposed to open and own the widget?
Yeah I am actually a beginner so it is hard for me
- There is a widget already created in the level and is displayed on the screen, and this widget contains an animation
2.There is an actor in the world, and has a script in it
Now, I want to call the Widget animation and play the animation whenever my character overlaps with the actor through the actor BP because all the script is present in the actor BP
I have multiple actors like this in the level, do I have to do it for all of them?
- all instances of the specified class:
- for only select few you could:
There are some other ways to select a bunch of specific actors, too.
I’d use the stuff I posted above, but hey - if it works, it works. Does it?
Yes it does, but I’ll anyways try everything that’ll workout with it, btw thanks for that you just saved my game
Sounds quite reasonable, indeed. Also, if you do not want to drag the red wire everywhere:
The delegate can also call a function instead. And the bind can be inside a function. Helps with clarity.
Good luck with rest!
I’ll understand and try this too!!