arnavkale
(arnavkale)
March 6, 2022, 9:51am
1
How can I use a BP actor to play a widget animation in Level
Everynone
(Everynone)
March 6, 2022, 9:57am
2
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:
Working with the LB is somewhat awkward in certain scenarios. You have some options, none of them is exactly pretty in BPs.
Dispatch from the Player
if the player is in the level already, have it call a dispatcher:
[image]
The LB can catch that call and fire a custom event or a function in response.
The Dummy
Another option is to place a tagged dummy actor in the level to handle the calls:
[image]
This actor would hold the streaming logic instead of the LB handling it. A side benefit i…
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.
arnavkale
(arnavkale)
March 6, 2022, 12:21pm
3
No I am using Level BP I just want to call it after you run over an Actor BP
Everynone
(Everynone)
March 6, 2022, 1:59pm
4
Is the actor BP in the level already? If so, select the actor and:
You have direct access to all persistent actors’ events.
arnavkale
(arnavkale)
March 7, 2022, 6:12am
5
I actually have a code with this, I want to access and call widget animations in ActorBP
Everynone
(Everynone)
March 7, 2022, 6:51am
6
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?
arnavkale
(arnavkale)
March 8, 2022, 3:55pm
7
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
Everynone
(Everynone)
March 8, 2022, 4:06pm
8
Nice & clear! Thanks.
In case that one bit is unclear:
arnavkale
(arnavkale)
March 8, 2022, 4:18pm
9
I have multiple actors like this in the level, do I have to do it for all of them?
Everynone
(Everynone)
March 8, 2022, 4:23pm
10
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.
arnavkale
(arnavkale)
March 8, 2022, 4:30pm
11
Yeah I did them this way is it okay?
Everynone
(Everynone)
March 8, 2022, 4:31pm
12
I’d use the stuff I posted above, but hey - if it works, it works. Does it?
arnavkale
(arnavkale)
March 8, 2022, 4:33pm
13
Yes it does, but I’ll anyways try everything that’ll workout with it, btw thanks for that you just saved my game
Everynone
(Everynone)
March 8, 2022, 4:38pm
14
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!
arnavkale
(arnavkale)
March 9, 2022, 4:49pm
15
I’ll understand and try this too!!