# Expose a Static Mesh Component from Code

**URL:** <https://forums.unrealengine.com/t/expose-a-static-mesh-component-from-code/54210>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [February 1, 2016, 10:56pm UTC](https://forums.unrealengine.com/t/expose-a-static-mesh-component-from-code/54210 "2016-02-01T22:56:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Jackblue](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jackblue/32/88706_2.png) [@Jackblue](https://forums.unrealengine.com/u/Jackblue)\
**Post date:** [February 2, 2016, 8:49am UTC](https://forums.unrealengine.com/t/expose-a-static-mesh-component-from-code/54210/2 "2016-02-02T08:49:27Z")

</div>

You simply need to initialize your component in your actor constructor and attach it to root.  
In this tutorial, he made it for a camera but, it’s exactly the same idea:

> **[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...

I hope this help you 🙂

---

_[View the full topic](https://forums.unrealengine.com/t/expose-a-static-mesh-component-from-code/54210)._
