I have a scenario where I am setting some values on a connecting player pawn. However, sometimes this code is called before the pawn exists in the world. I can easily check if the pawn reference is valid or not but I need to keep checking if it’s valid asynchronously and run the code when it finally is valid.
In blueprints, I would have this crude solution of checking if it’s valid. If it’s not valid, delay for .2 seconds then check again.
In C++, I have found asynchronous tasks which seems like overkill for what I need. I could also run a timer every .2 seconds to check if the reference is valid and run the code (then pause the timer) if it is. But both of these seem like over-engineered systems to handle this.
I’m sure people run into this issue all the time and I’m wondering what you guys have done to get around this