Search code examples
blueprintunreal-engine5

How to change text in textblock from onclick button event in UE5?


I am new to Unreal Engine. Currently I am learning UE5. I am trying to change text and I had run into problem. And somehow I can't find any information about it.

I simply created user widget, I put a button and a text block. So the question is how can I change text in text block using onclick button event?


Solution

  • I found the solution. It was easier than I thought. enter image description here

    1. First mark your text as variable. Then literally [Get] it in ur bp.
    2. Get a branch [set 'name'] from your text (I my case Head Txt).
    3. Then from Set set a branch [SetText] and type ur text.

    That's it! Can't believe I spent so many time trying to find the solution in blueprint videos, but accidently found out how to do this from C++ code.