Function when called crashes the editor and game
Whenever this function is called, it causes the whole editor to crash.
Does anyone have any clue why this is? Because it crashes the editor I can't try to see whats wrong.
It seems you missed out some null check.
CurrentActor is safe because for loop itself guarded it once from de-reference with invalid index. Casting on CurrentActor is also safe because casting on nullptr will get nullptr.
However, CharacterToLaunch may fail because not all AActors are ACharacters. In which case some of it would be nullptr. Then attempt to call a function that belongs to ACharacters from non-ACharacters, will crash for sure.
Let me know if this fixed your issue with this:
Follow this question
Once you sign in you will be able to subscribe for any updates here