# What are a few good ways to access the same user created code from two different Plugins.

**URL:** <https://forums.unrealengine.com/t/what-are-a-few-good-ways-to-access-the-same-user-created-code-from-two-different-plugins/351253>\
**Category:** Plugins\
**Tags:** unreal-engine, linking, Plugins, question\
**Created:** [March 22, 2016, 3:07am UTC](https://forums.unrealengine.com/t/what-are-a-few-good-ways-to-access-the-same-user-created-code-from-two-different-plugins/351253 "2016-03-22T03:07:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spiris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spiris](https://forums.unrealengine.com/u/Spiris)\
**Post date:** [March 22, 2016, 3:07am UTC](https://forums.unrealengine.com/t/what-are-a-few-good-ways-to-access-the-same-user-created-code-from-two-different-plugins/351253/1 "2016-03-22T03:07:04Z")

</div>

I am building two different plugins, which will be called Plugin A and Plugin B. As an example I have made a class that extends from FString (Any UE4 class, really) that is used in both Plugin A and Plugin B. What are a few good ways to do this?  
I have tried:  
Creating a third Plugin that is accessed from both Plugin A and Plugin B. This causes the editor to crash on load.  
Writing the same code in both Plugins, this results in compile errors, even though the code is in separate modules.  
Creating a new module that can link to both from the game folders. This also crashes at load time.  
I am looking for functionality the same way that c# compiles class libraries that can be used in other class libraries, that then can be linked to the main game code. I have a few more ideas involving namespaces at this point, but the fact this is as nonintuitive as it is already warranted a post.

Best,  
Spiris.

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [March 22, 2016, 2:23pm UTC](https://forums.unrealengine.com/t/what-are-a-few-good-ways-to-access-the-same-user-created-code-from-two-different-plugins/351253/2 "2016-03-22T14:23:09Z")

</div>

If Plugin B needs Plugin A to run, in Plugin A’s .uplugin file inside the **“Modules”: […]** body, set

```
"LoadingPhase": "PreDefault"

```

While in Plugin B’s .uplugin, set

```
"LoadingPhase": "Default"

```

Then it won’t crash and B plugin can run using A’s classes.

---

<div class="post-metadata">

**Author:** ![Spiris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spiris](https://forums.unrealengine.com/u/Spiris)\
**Post date:** [March 24, 2016, 3:02am UTC](https://forums.unrealengine.com/t/what-are-a-few-good-ways-to-access-the-same-user-created-code-from-two-different-plugins/351253/3 "2016-03-24T03:02:56Z")

</div>

Awesome, using this suggestion and a separation of concerns involving modules yielded the desired result.  
Thank you!  
Spiris.
