Calling destroy self c++ function from BP causes short freeze first time only
Suppose we have the following Blueprint Callable c++ function in MyGameState:
Suppose as well that a Blueprint child class of Subactor, called "SubActorBP", has a blueprint function called "DestroySelf" which essentially does the Blueprint-equivalent of the following code:
That is, it calls the DestroySubactor function from the game state on itself.
The first time an instance of SubActorBP calls DestroySelf, then the game freezes anywhere from 5 to 30 seconds, and then the function successfully executes and the game continues as normal. Then any subsequent calls of DestroySelf from any instance of SubActorBP executes smoothly without freezing.
Why does this happen? And how do I prevent the initial freezing? Preferably a method that still calls the c++ function from Gamestate, because that function does other necessary stuff besides destroying the actor.
Follow this question
Once you sign in you will be able to subscribe for any updates here