Then I have a global variable I want to set to that messagestring so I can anlayse that json payload and update my variables accordingly based on the message.
so all i want to do is call the playermatched function in the onmessage event from the websocket. so everytime a message is received. That function gets called and the parementer gets passed.
I feel like im going in circles at this point, I am still learning. Any guidance would be greatly apreciated. thank you in advance!
When using lambdas with UObjects, prefer using WeakLambdas, so you won’t run into crashes due to a delegate being called on an object that doesn’t exist anymore.
GameInstance isn’t likely to be destroyed, but still I feel like there’s a decently high chance of your game crashing on exit. It works almost the same way you just pass the object as parameter first :