# How do I use UProceduralMeshComponent? (can't #include)

**URL:** <https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 26, 2015, 11:22am UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116 "2015-06-26T11:22:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_633c8c21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_633c8c21](https://forums.unrealengine.com/u/anonymous_user_633c8c21)\
**Post date:** [June 26, 2015, 11:22am UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/1 "2015-06-26T11:22:26Z")

</div>

I want to add a Procedural Mesh Component to my Actor, but I don’t seem to be able to #include it. What do I include to make the C++ code recognize UProceduralMeshComponent?

I did see  
[this suggestion](https://answers.unrealengine.com/questions/241899/procedural-mesh-component-classes-and-documentatio.html), using a blueprint to do the actual component adding, but that has not worked out well for me. Every time I restart my project, the blueprint forgets it has a ProceduralMeshComponent, and I have to add it again.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_633c8c21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_633c8c21](https://forums.unrealengine.com/u/anonymous_user_633c8c21)\
**Post date:** [June 26, 2015, 1:31pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/2 "2015-06-26T13:31:58Z")

</div>

I think I may have solved it. By using the component in the blueprint, I was able to locate the class in the content browser. From there, I could create a derived C++ class, which was fully usable without any compiler errors.

---

<div class="post-metadata">

**Author:** ![toxicwolf\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@toxicwolf\_1](https://forums.unrealengine.com/u/toxicwolf_1)\
**Post date:** [August 11, 2015, 12:00pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/3 "2015-08-11T12:00:14Z")

</div>

I was having the same problem so tried resolving it as you did, by creating and using a subclass of UProceduralMeshComponent, which does the job. I noticed that the header file generated by the editor contains an #include for the component, so I tried copying it into the header for the actor and while VS complains, it does compile! No dummy class needed.

---

<div class="post-metadata">

**Author:** ![toxicwolf\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@toxicwolf\_1](https://forums.unrealengine.com/u/toxicwolf_1)\
**Post date:** [August 11, 2015, 12:02pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/4 "2015-08-11T12:02:57Z")

</div>

Add the following to your Actor’s header file:

```
#include "ProceduralMeshComponent.h"

```

While Visual Studio will complain about not being able to open the source file, it should compile just fine.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2fb2a633](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2fb2a633](https://forums.unrealengine.com/u/anonymous_user_2fb2a633)\
**Post date:** [August 16, 2015, 10:57am UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/5 "2015-08-16T10:57:26Z")

</div>

Why the same is not working for me? I wrote #include “ProceduralMeshComponent.h” but code is not compiling with it, also this header file is on Plugins folder of Engine, so probably there is another way to set up this plugin?

---

<div class="post-metadata">

**Author:** ![chrisrf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@chrisrf](https://forums.unrealengine.com/u/chrisrf)\
**Post date:** [September 8, 2015, 4:16pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/6 "2015-09-08T16:16:36Z")

</div>

This doesn’t work for me. My compile fails because “Error C1083: Cannot open include file: 'ProceduralMeshComponent.h” : No such file or directory"

I’m using 4.9, why is it working for you but not for me?

---

<div class="post-metadata">

**Author:** ![timtimmy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@timtimmy](https://forums.unrealengine.com/u/timtimmy)\
**Post date:** [September 8, 2015, 9:18pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/7 "2015-09-08T21:18:25Z")

</div>

A dependency to the ProceduralMeshComponent module is required in one’s ModuleRules build file. For example:

MyGame.Build.cs

```
public class MyGame : ModuleRules
{
    public MyGame(TargetInfo Target)
    {
        PrivateDependencyModuleNames.AddRange(new string[] {"ProceduralMeshComponent"});
    }
}

```

One can then include `ProceduralMeshComponent.h` in C++ code:

```
#include "ProceduralMeshComponent.h"

```

Anyways, that’s what worked for me.

---

<div class="post-metadata">

**Author:** ![reaganry](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@reaganry](https://forums.unrealengine.com/u/reaganry)\
**Post date:** [September 30, 2015, 9:19pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/8 "2015-09-30T21:19:27Z")

</div>

i followed timtimmy above & i was finally able to get simplecylinderactor code on this page to work in 4.9 [Generate Procedural Mesh - C++ - Unreal Engine Forums](https://forums.unrealengine.com/showthread.php?1552-Generate-Procedural-Mesh/page9)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b4bf8ebc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b4bf8ebc](https://forums.unrealengine.com/u/anonymous_user_b4bf8ebc)\
**Post date:** [October 29, 2015, 11:35am UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/9 "2015-10-29T11:35:54Z")

</div>

I’ve created an extremely simple example of using UProceduralMeshComponent purely in C++. You can view it here:

> **[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 — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_633c8c21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_633c8c21](https://forums.unrealengine.com/u/anonymous_user_633c8c21)\
**Post date:** [November 24, 2015, 3:47pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/10 "2015-11-24T15:47:36Z")

</div>

Apparently, what happens is that once you create a derived class, “ProceduralMeshComponent” automatically gets added to the “AdditionalDependencies” section of the .uproject file, thus allowing the header to be freely included anywhere after that.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0cc0891d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0cc0891d](https://forums.unrealengine.com/u/anonymous_user_0cc0891d)\
**Post date:** [March 4, 2017, 3:03am UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/11 "2017-03-04T03:03:19Z")

</div>

hello ,have you resolve this question? could you tell me? i am very thanks for you.

---

<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:** [March 26, 2018, 7:16pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/12 "2018-03-26T19:16:55Z")

</div>

Follow this tutorial: [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/Procedural_Mesh_Component_in_C%2B%2B:Getting_Started)

---

<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:** [March 26, 2018, 8:13pm UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/13 "2018-03-26T20:13:58Z")

</div>

Sometimes this happens. Watch out !

1\>WARNING : warning : Plugin ‘xxxxx’ does not list plugin ‘ProceduralMeshComponent’ as a dependency, but module ‘xxxxxx’ depends on ‘ProceduralMeshComponent’.

This happens because you have to add the plugin to your uplugin file, in case you are building a plugin not a project using this other plugin:

```
 "Modules": [
     {
       "Name": "MyPlugin",
       "Type": "Runtime",
       "LoadingPhase": "Default"
     }
   ],
   "Plugins": [ // <--
     { // <--
       "Name": "AdditionalPlugin", // <--
       "Enabled": true // <--
     } // <--
   ]   

```

> **[Plugin dependent on another plugin](https://forums.unrealengine.com/questions/573095/plugin-dependent-on-another-plugin.html)**
>
> Hi, We’ve built the core of our project as a plugin because it serves as base for multiple uprojects. Our plugin depends on 2 other plugins, one of which is an engine plugin (WebBrowserWidget) and the other is FMODStudio (we’re using it as C++...

---

<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:** [March 27, 2018, 8:45am UTC](https://forums.unrealengine.com/t/how-do-i-use-uproceduralmeshcomponent-cant-include/323116/14 "2018-03-27T08:45:08Z")

</div>

For me, using PrivateDependencyModuleNames didn’t work. It works with Public version of the variable instead.
