# Best way to add mesh on the map with a command

**URL:** <https://forums.unrealengine.com/t/best-way-to-add-mesh-on-the-map-with-a-command/228821>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [May 11, 2021, 3:20pm UTC](https://forums.unrealengine.com/t/best-way-to-add-mesh-on-the-map-with-a-command/228821 "2021-05-11T15:20:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cobiyyy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cobiyyy](https://forums.unrealengine.com/u/Cobiyyy)\
**Post date:** [May 11, 2021, 3:20pm UTC](https://forums.unrealengine.com/t/best-way-to-add-mesh-on-the-map-with-a-command/228821/1 "2021-05-11T15:20:34Z")

</div>

Hi, i am looking for a way to add a static mesh on the map with a command by stating its name its location and rotation like

example:  
add mesh\_name 200,10,0 0,0,0 would add the mesh at the location with the rotation.

Would anyone know if thats a thing and how to do something like this?

Edit: when you copy a mesh in game you can edit the string it copys with custom values and then paste it back it.

---

<div class="post-metadata">

**Author:** ![fxtd-odyssey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fxtd-odyssey](https://forums.unrealengine.com/u/fxtd-odyssey)\
**Post date:** [May 12, 2021, 12:37am UTC](https://forums.unrealengine.com/t/best-way-to-add-mesh-on-the-map-with-a-command/228821/2 "2021-05-12T00:37:17Z")

</div>

[https://docs.unrealengine.com/en-US/PythonAPI/class/EditorLevelLibrary.html?highlight=spawn#unreal.EditorLevelLibrary.spawn\_actor\_from\_object](https://docs.unrealengine.com/en-US/PythonAPI/class/EditorLevelLibrary.html?highlight=spawn#unreal.EditorLevelLibrary.spawn_actor_from_object)

```auto
for asset in unreal.EditorUtilityLibrary.get_selected_assets():
    unreal.EditorLevelLibrary.spawn_actor_from_object(asset,unreal.Vector())

```

Above Python code would spawn the selected asset into current world.

---

<div class="post-metadata">

**Author:** ![midgunner66](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/midgunner66/32/466711_2.png) [@midgunner66](https://forums.unrealengine.com/u/midgunner66)\
**Post date:** [May 12, 2021, 1:56am UTC](https://forums.unrealengine.com/t/best-way-to-add-mesh-on-the-map-with-a-command/228821/3 "2021-05-12T01:56:04Z")

</div>

Got info from here: [Call Blueprint Event from Console - #5 by Irascible](https://forums.unrealengine.com/t/call-blueprint-event-from-console/9245/5)

In your Level Blueprint:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/0/b009aad2820cd3d376b31c42a2c55d3dfd35862c.png)  
In the in-game console, type `ce AddStaticMesh [path] [x] [y] [x] [roll] [pitch] [yaw]`.

Example:  
`ce AddStaticMesh /Game/StarterContent/Props/SM_TableRound 0 370 325 0 0 0`  
 ![add static mesh](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/7/b77bb16682802891b5d8328044c6c5ad6aa75b6e.gif)

* * *

If you don’t want to do it this way, you can try this tutorial: [Unreal Engine - Create console commands in blueprints // Sahil Dhanju's Blog](https://sahildhanju.com/posts/create-console-commands-in-blueprints/). It requires c++, but allows you to create console commands from blueprints.

---

<div class="post-metadata">

**Author:** ![Cobiyyy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cobiyyy](https://forums.unrealengine.com/u/Cobiyyy)\
**Post date:** [May 12, 2021, 5:46pm UTC](https://forums.unrealengine.com/t/best-way-to-add-mesh-on-the-map-with-a-command/228821/4 "2021-05-12T17:46:43Z")

</div>

Hi, thanks for your reply but i was asking about adding static mesh to the world it self (outside the game)

---

<div class="post-metadata">

**Author:** ![midgunner66](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/midgunner66/32/466711_2.png) [@midgunner66](https://forums.unrealengine.com/u/midgunner66)\
**Post date:** [May 12, 2021, 9:58pm UTC](https://forums.unrealengine.com/t/best-way-to-add-mesh-on-the-map-with-a-command/228821/5 "2021-05-12T21:58:36Z")

</div>

So do you mean add it in-game and have it save and be there the next time you open the level? Or do you mean through a text file outside the game?

---

<div class="post-metadata">

**Author:** ![Cobiyyy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cobiyyy](https://forums.unrealengine.com/u/Cobiyyy)\
**Post date:** [May 16, 2021, 9:32pm UTC](https://forums.unrealengine.com/t/best-way-to-add-mesh-on-the-map-with-a-command/228821/6 "2021-05-16T21:32:10Z")

</div>

This topic is solved anyway i found the solution I needed.
