How to make a widget spawn when a certain level opens. Thirdpersoncharacter blueprint

Hi
I want a widget to show up so I can select what vehicle I want; however, I don’t know how to make the widget open on a specific level only.


I can’t do the script into the level blueprint because I have a scene component named target which in my viewport which I need. Plz Help

Could you clarify this?

The scene component ‘Target’ is where the vehicle would spawn once I have chosen one from the widget.

You could get the ‘Target’ scene component (in your ThirdPersonCharacter) from the level blueprint by getting the Player Pawn.
Something like this in the level blueprint:

1 Like

Still unclear. Where is this scene component? In the level already, part of another blueprint that has yet to be instantiated?

The Scene component is in my thirdpersoncharacter blueprint


It won’t work. Here is the script I did in the widget part where I select a vehicle did I do something wrong?

  • instead of getting a transform, you’re setting it - you want to read, not override its location, right?
  • the nodes are not even connected
  • bottom pic: remove the widget after everything else has been done - just in case, even though it may seem to work OK now

select what vehicle I want

In the widget - what do you do to actually select the car? Click a button? That it?

Yes, I have a button with an image in it and when you click a button it does that code.

I would do it like this:

Spawn the car in the LVL, no need to have it in the widget and complicate things. You can skip the new var 0 if you do not need to use this widget again to re-spawn a car or spawn another car.


Depending on the scope of what is really needed, I’d probably choose a class in the widget and then dispatch just the vehicle class. Easier to work with later on. And I would also encapsulate the above script in an actor so I can add it to the levels I want rather than copy-paste or rewrite for many levels. Just thinking ahead, tis all.

1 Like

Hey one more question, how would I spawn the other vehicles on the widget as well as I can only spawn one from your script?

Depending on the scope of what is really needed, I’d probably choose a class in the widget and then dispatch just the vehicle class. Easier to work with later on.

As mentioned above:

  • in the widget:

  • in the lvl:

And as with everything else, this can be further optimised, improved, ironed out…


You can assign an enent by dragging a wire from the widget like so: