HI, My widget has an event on construction which has a code of blueprint in which it needs to acces an array variable from game mode blueprint. But the problem is that on getting the game mode from the widget blueprint, on debug, it shows “not in scope”. In my understanding widget blueprint is unable to access or communicate with gamemode blueprint to get the required array variable. I need to know why and if the answer is that construction events cant access gamemode blueprints then how to get a variable from another blueprint from the construction event?
PS: I have tried the same thing with Gamestate and Gamestate base but results were the same. I am unable to access the variable anyhow for now.
Ingame: when the widget is added to viewport, it should point it on that breakpoint, mouseover the return value of game mode should return the proper values since the casting isnt failing.
I think your game mode is working, it just missing the breakpoint most likely.
That was not my question, though. If the cast does not fail, it means the object is accessible. Add a string variable to the game mode, access it instead of Towers and print its value. What do you get?
With string variable and printing it getting the BP_Gamemode but on debug it still shows not in scope plus the value of variable “Tower” is also not in scope which is the main problem.
I also tried something in the meanwhile which is casting to gamemode and calling the variable from outside this function directly in the event construct and adding an input to get static meshes function of the same type as tower variable. In this case everything works fine until code enters the function and then the variable is out of scope or “not in scope” to be exact