Cant set this widget component

Hi
I have created a actor Blueprint component to add to A players characters.
And I’m trying to get the component to spawn/add/create a widget component and attach it to the players camera, But I’m unable to set this widget component variable I created.
Is what I’m trying to do possible.

1 Like

There are a few things that I need a clear understanding of here.
What’s your final intention? Why would you want to attach the widget to the camera? Can’t you just display it on the screen normally?

Also, I see that your custom event is saying “Spawn” but I don’t know where you initialize the widget. If there’s no initialization then there’s no value to be set at the start/“spawn”. If you have initialised it then simply drag from the return value and you can access all the variables you want.

I spent some time on this last night and changed how I want the system to work.
Now its a actor component I add to my character which spawns 2 other actors which both have UMG widgets.
The component has all the values I need and the spawned UMG widgets in those spawned actors will use those vaules .
But Im not able to get the parent / owner of the spawned actors which should be the actor component instance. to update those umg widgets with those values on testing.

Again, I don’t quite get it, why not just create the widget from the actor itself? Why go all the trouble to have an actor component who will then spawns another 2 actors which have their own UMGs?

Complexity will cost you performance. Make it simple and easy to control.
Can you show me what your goal is? I’m sure we can discuss a better way to do it. Of course, you can access those variables after you referenced them.

Its a modular VR health system for the marketplace.

1 Like

So, my guess is the 3d widget display.
If you trying to get an owner it needs to be defined somewhere first. But, I really hate the “get owner” node so I come out with my own method. I think it will work for you too. :slight_smile:

  1. Inside the child class create a new variable type the “parent” class and call it ParentRef. Make sure you check these boxes and compile them.

  2. Inside the parent class, where you call the “spawn actor from class”, it will ask to input the ParentRef variable. Just set it to self.

  3. Now you can access the event/variable inside the parent’s class.

1 Like