# \[QUESTION\] Apply Static Mesh to StaticMesh component

**URL:** <https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575>\
**Category:** Asset Creation\
**Tags:** unreal-engine, UE4, CPP, question\
**Created:** [March 20, 2014, 7:18pm UTC](https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575 "2014-03-20T19:18:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_bda7d120](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bda7d120](https://forums.unrealengine.com/u/anonymous_user_bda7d120)\
**Post date:** [March 20, 2014, 7:18pm UTC](https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575/1 "2014-03-20T19:18:36Z")

</div>

I’m sure it’s accomplished by the SetStaticMesh(UStaticMesh \*NewMesh); function.  
However, I’m not sure how to get the static mesh reference of the mesh from my content browser.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [March 20, 2014, 7:21pm UTC](https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575/2 "2014-03-20T19:21:16Z")

</div>

That’s easy!

#C++ Constructor

Right click on your static mesh asset and select “Copy Reference”

Than paste into code in constructor

```
AJoySMA::AJoySMA(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
//Mesh
static ConstructorHelpers::FObjectFinder<UStaticMesh> StaticMeshOb_torus(TEXT("StaticMesh'/Engine/EditorShapes/Meshes/Shape_Torus.Shape_Torus'"));
if (StaticMeshOb_torus.Object)
StaticMeshComponent->SetStaticMesh(StaticMeshOb_torus.Object);

```

or

#Blueprinted Class Property

#.H

create a blueprinted version of your class, and make a UStaticMesh\* so you can assign the static mesh in the editor.

The value set in BP should only be accessed after PostInit.

```
/** SM Asset for Player Starts */
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=StaticMeshAssets)
UStaticMesh* AssetSM_PlayerStart;
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_bda7d120](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bda7d120](https://forums.unrealengine.com/u/anonymous_user_bda7d120)\
**Post date:** [March 20, 2014, 7:35pm UTC](https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575/3 "2014-03-20T19:35:22Z")

</div>

Thanks!? It works!  
Where did you come across this? I need a great reference.  
Furthermore, how would I get the position of the static mesh component?  
I’m only struggling with the API. Steep learning curve, haha.

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [March 20, 2014, 7:44pm UTC](https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575/4 "2014-03-20T19:44:22Z")

</div>

Dear Skydive,

please post each of your questions as a separate thread for easier searches for future users.

I can then answer them 🙂

I’ve been working with UE4 engine for months so I"ve learned a lot on my own 🙂

#I’ve posted many tutorials on the wiki here:

**UE4 Wiki**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

<div class="post-metadata">

**Author:** ![darkgaze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@darkgaze](https://forums.unrealengine.com/u/darkgaze)\
**Post date:** [August 21, 2017, 11:09am UTC](https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575/5 "2017-08-21T11:09:15Z")

</div>

You can read a longer description for the C++ version in Unreal Engine 4 Cookbook in Packt. You can read the first lines here. The books is from 2016 and I recommend it a lot.

> **[Search | Packt Subscription](https://subscription.packtpub.com/search?query=loading%20assets%20into%20components%20using%20fobjectfinder)**
>
> Search over 7,500 Programming & Development eBooks and videos to advance your IT skills, including Web Development, Application Development and Networking

---

<div class="post-metadata">

**Author:** ![MVXI](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mvxi/32/613369_2.png) [@MVXI](https://forums.unrealengine.com/u/MVXI)\
**Post date:** [September 13, 2017, 12:16am UTC](https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575/6 "2017-09-13T00:16:03Z")

</div>

Hey darkgaze, from where did you get this book? I tried to find a free pdf on google but I couldn’t. Could you help me?

---

<div class="post-metadata">

**Author:** ![darkgaze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@darkgaze](https://forums.unrealengine.com/u/darkgaze)\
**Post date:** [September 13, 2017, 7:22am UTC](https://forums.unrealengine.com/t/question-apply-static-mesh-to-staticmesh-component/277575/7 "2017-09-13T07:22:57Z")

</div>

Do what I did. Pay for it. It’s worth it. I suggest you follow this website: everyday, they give a book for free. Other times books are 5 dollars or something like that. [Free Learning | Daily Programming eBook from Packt](https://www.packtpub.com/packt/offers/free-learning)
