Can't create "Event BeginPlay" inside a widget blueprint

Hello,

I would like to create a map(widget), from which you can teleport yourself to some points of the map(buttons).

I’ve created a map and buttons, then clicked “Events” “On Clicked” on a button and already wanted to create my teleportation blueprints.

I need to cast my character first. Usually, before this map I casted it through BeginPlay Event.(as in #1) But now there is no “Event BeginPlay” in widget’s blueprints, but there is “Event Pre Construct”. Should I use “Event Pre Construct” (#2) instead of Event BeginPlay(#1) in the widget bluprint, for casting the character?

Thank you.
Alex

Event construct = Event Begin Play

2 Likes

Thank you YUHBE3!

Not exactly the same because Event Construct is being called whenever the widget is added to viewport not only when the widget is created for the first time.

For example, if you bind something in the event construct it will be binded again when the widget is removed from parent and added to the viewport again.

So be cautious about this. You can rather use “Event On Initialized“

1 Like