PLEASE HELP Blueprint : Interact with object to play video in widget

I am new to UE, please help me understand how can I make this work: i want to play wideo in widget which is relevant to certain actor. I have 9 actors with different static meshes, but actors are same class and each of them is supposed to have their own animation showing in widget.
Here is my logic for highliting and selecting actors:

And then I want to click on selected actor with left mouse button to trigger my Onclicked event in actor.

But I dont know how to open ,whats inside my actor"

Everything worked fine when I had one widget and one animation for all child actors and It looked like this:

But I have 9 different actors (but same class) and each of them is supposed to show another interface with different animation.
Please help <3

you should drag from SelectedActor pin to see what functionality this class contains.

I advise to you implement two interfaces: one for actors with GetEmbeddedMedia(), and another for widget PlayMedia().

Implement in your parent actor GetEmbeddedMedia(), which will return default media link. And change default link to the appropriate link in each actor.
OnClick call GetEmpeddedMedia() on the selected actor, then call PlayMedia() on your widget with link from actor (expand this interface for this widget before).

Thanks for your quick response. I will try it tomorrow! But now it seems quite logical to me :slight_smile:

1 Like

Hi,
I still cant do this, is it possible that you show me your logic on some example? Please :slight_smile:

Hi again Ewel,

So each of your 9 actors needs to have a way of telling the “TouchandPlay” widget what video to play.

This would take the form of an exposed variable. (variable type would depend on what sort of info the widget wants to select the correct video)

Also, if you’re only using the UMG widget for just holding the video, please know that another approach would be to just select what ‘video texture/material’ to play on a static mesh. (No UMG approach)

If your project is small (<5GB?) consider uploading it for us to poke at. (File → ‘Zip Project’)

Thanks, i will upload the test project :slight_smile: But I think i also can make 9 different widgets with 9 different animations in them (using Open source in widget event graph). Unfortunately i don’t know how to assaign relevant widget to child actor and access the widget on clicking the child actor. The parent actor is my Decal that highlights when in the line of the sight.

Ok, Here is the test project file to download

There are 2 animations, 2 media players- 2 media textures for testing.
Please show me on this example how to use GetEmbeddedMedia and PlayMedia or the exposed variable to access the media textures and players and open widget
Thanks for your help!

Thanks for sharing!

After a bit of unsuccessful poking, I thought it better to make a new project that shows a way to set up what you’re after.

AJ_PlayMedia.zip (21.8 MB)

There is a new (as of 5.1 I think!) feature called ‘Media Plate’ and working with video is exponentially easier.

It makes more sense to show the videos in the 3d environment instead of plastered to screen as UMG widget right?

Note: on the Media Plates placed in the level: I changed ‘Actor Hidden in Game’ to true. Also ‘Play only when visible’ to true. (It unhides the referenced media plate when the object is clicked on)

Good job with your project, as a ‘UE beginner’ you are combining “intermediate” systems with success.

Thank you very much for your involvement!
Unfortunately, I need to make this animations in widget, so that they are full screen…
I decided to make separte widgets for each child actor and it works fine as I click them and it opens relevant widget. But… there is a snag. I made the system of highlighting object in line of my sight and when i add to this clicking by cursor it seems unintuitive.
I share my test project to dowload.

Please help me to somehow connect the fun of realitime highlighting with action of clicking. Maybe I should make new Bp interface named Clicking Actors, make an event from it in child actor (insted of OnClickedevent) and call this in my bp First Person Character after checking if selected actor is valid? The point is to highlight actor with it selected click anywhere in space (no cursor visible) to access the event inside child actor (the event that creates widget).
Thanks for your help and support. Its nice to code with nodes as i am 3d artist and they are in use in all 3d software :slight_smile:

You got it working, nice!

I think you’re just missing this ‘EnableMouseOverEvents’ node

Then you can use the ‘Event ActorBeginCursorOver’ (and EndCursorOver) to drive the highlighting.

Yes! That was the point :slight_smile:
Problem solved, thank you very much!

1 Like