unreal-engine5unreal-blueprint

How do i communicate between a widget and level blueprint?


I want to make a widget that has a restart button, but I have no idea how I'm supposed to tell the level blueprint that I clicked the button. And there's no way to get the player start object into the widget blueprint.

I've scraped the internet to no avail.


Solution

  • it is not possible to talk to the level blueprint through a widget as far as i know. I'm not sure what you are trying to do as you could just execute the respawn code through the widget using on clicked. I would stay away from using the level blueprint as it is harder to cast to. I would use something like a game instance,player charater or even the game mode or an actor. See unreal documentation... https://docs.unrealengine.com/5.0/en-US/BlueprintAPI/Utilities/Casting/ https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Utilities/GetActorOfClass/