# Drawing world from c++

**URL:** <https://forums.unrealengine.com/t/drawing-world-from-c/68468>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [July 8, 2016, 10:46am UTC](https://forums.unrealengine.com/t/drawing-world-from-c/68468 "2016-07-08T10:46:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_4c6380f9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4c6380f9](https://forums.unrealengine.com/u/anonymous_user_4c6380f9)\
**Post date:** [July 8, 2016, 10:46am UTC](https://forums.unrealengine.com/t/drawing-world-from-c/68468/1 "2016-07-08T10:46:13Z")

</div>

Hi,  
I want to be able to drawing on my editor from my c++ code.

Let me explain better.  
It is possible from c++ code add new instance of an assent directly into editor scene. I want do something like a “world generator” from code.

Example:  
Suppose that I want to do a race car game. Suppose that I have a street asset. Tipically from the editor I can move my StreetAsset into the scene and then I can modified some parameters. I want write an algorithm that insert my StreetAsset into the editor scene.

It’s possible? Any suggestions are appreciated.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Young\_Wolf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Young\_Wolf](https://forums.unrealengine.com/u/Young_Wolf)\
**Post date:** [July 8, 2016, 7:14pm UTC](https://forums.unrealengine.com/t/drawing-world-from-c/68468/2 "2016-07-08T19:14:03Z")

</div>

It’s possible, you have to extend an Actor class I suppose, and build all generator functionality there. Like spawning assets, location, rotation, stacking etc. Then spawn it and let it generate a world.

For example a very simple solution is:  
Suppose you have a tiling model, with sizes 200x200x50 (for example)

You create a reference of it in C++ and then in BeginPlay() method, you would do something like:  
_NOTE: THIS IS PSEUDO CODE_\*\*

```auto

for(int i = 1; i < 11; i++)
{
     FVector3 Location = (0, 200 * i, 0);
     World->Spawn(myAsset, location);
}

```

That would spawn a mesh 10 times in a straight line.
