How can i change a text value in widget blueprint from c++…Please help
How to change value of text in a widget blueprint from c++
- Create class for widget.
- In C++ add a variable: UPROPERTY(Category = UserInterface, EditAnywhere, BlueprintReadWrite)
- In widget set this new C++ class as parent class.
- Bind any control with text field to this variable.
- Change TextToChange from C++ level.
I was able to access texttochange from blueprint but when i change its value from the code the game crashes…Please help
Just wanting to say for anyone else that has their game crash you must check if your widget is not null before setting the variable. Spent a couple of minutes trying to figure it out.