How can I spawn a sphere in C++?

If I put the above code in a loop with >2 iterations, it crashes the editor…