I am making a test level, in which i am receiving a movement string from the player like this ( “LRFBLLF” ) for forward, backward, left, and right. I am using the UI widget blueprint to get the string. Now i want to control my actor accordingly. first problem that i face is i am unable to access my widget string variable in the actor blueprint. And second how do access the string character by character till the string length and update the actor position?
i have attached the snap shot of part of my blueprint where i am trying to test the string on actors blueprint. But i get nothing on the screen.
I need help in creating this using blueprints… Plz help me out!
First of all could you show us how you set the value to BotStr ? You can expose a variable of your widget by checking “Is Variable” in the designer module of the widget window :
This will be accessible outside the widget.
Then to go though a string you need to use GetCharacterArrayfromString and then use a foreach on the array.
It seems to be set correctly.
Does the game print anytext on the screen or not ? Because it should write :
Server : TEXT HERE
So even if there is no text you should see "Server : ". If you do not check the console output to look for the message of there is nothing there maybe an issue with something else.
You could try to add a text label in your UI Widget and bind it to the BotStr so you could see live what the BotStr is.
Did you try to debug it to see where the problem starts ?
Does the Append work ? Does the set BotStr work ?
If yes is you Bot 3 UI Widget valid (Not NULL) ? If yes can you get anything else from it ?
yes i have tried debugging it. Everything seems ok. I can print the bot string value from the widget, but i can not get the string value in other blueprint.
Yes you created it here but (sorry I wasn’t clear) where do you set it to a variable ? Because you are using a Bot 3 UI Widget variable but how do you set it ?
There it is ! That is your issue.
Here you are creating a variable but it is empty, you do not set it with the reference of the widget.
What you should do is call an event FROM the widget and give the BotStr in the event.
I am also doing the same thing. Anyway i am able to access the variable in my level blueprint, and not in other widgets blueprint.
I think it is may be because of the fact that widget blueprint is like an abstract class, which gets called at run time. So i have got may way around it. But still thanks for your cordial support. (Y)
But i was wondering if we can access the level variable in other actors blueprint or not?? Cause i was not able to instantiate the object of the level blueprint. What do you think?