How to automatically add a specified actor to the current level?

Add a specified actor to the current level, how to programmatically implement this functionality.Can you give me some ideas?

From what I get you wish to spawn an actor from C++. In that case:

Example code:


ATextRenderActor* text = GetWorld()->SpawnActor<ATextRenderActor>(spawnLocation, spawnRotation);

Can do it anywhere you have access to GetWorld() … PlayerController, any Actor, GameMode, etc.