# Should I use plugins or plain objects inherited from UObject for a numerical solver?

**URL:** <https://forums.unrealengine.com/t/should-i-use-plugins-or-plain-objects-inherited-from-uobject-for-a-numerical-solver/500809>\
**Category:** Plugins\
**Tags:** unreal-engine, UE5-0, UE4, UE4-27\
**Created:** [February 22, 2022, 3:39am UTC](https://forums.unrealengine.com/t/should-i-use-plugins-or-plain-objects-inherited-from-uobject-for-a-numerical-solver/500809 "2022-02-22T03:39:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlixzhao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@charlixzhao](https://forums.unrealengine.com/u/charlixzhao)\
**Post date:** [February 22, 2022, 3:39am UTC](https://forums.unrealengine.com/t/should-i-use-plugins-or-plain-objects-inherited-from-uobject-for-a-numerical-solver/500809/1 "2022-02-22T03:39:17Z")

</div>

Basically, I want to implement some numeral algorithms in the unreal engine, like finite differencing and RK4. I think I have several ways to do it. I can add a plugin and write my code there. Or I can just add a new c++ class inherited from UObject and include that class whenever I need it. Which way should I go, or is there any other recommended best practice for this task?

---

<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:** [February 22, 2022, 5:09am UTC](https://forums.unrealengine.com/t/should-i-use-plugins-or-plain-objects-inherited-from-uobject-for-a-numerical-solver/500809/2 "2022-02-22T05:09:05Z")

</div>

> [@charlixzhao](#):
>
> Basically, I want to implement some numeral algorithms in the unreal engine, like finite differencing and RK4. I think I have several ways to do it. I can add a plugin and write my code there.

The easiest way I can think of is:

1. Get the plugin template ([https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/Plugins/](https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/Plugins/)) from UE4 Editor for a Blueprint Function Library  
(last time I checked, 4.27 didn’t have all the usual plugin templates, so use prior version if necessary)

2. Add your code there.

Now you have a plugin that contains statically accessible nodes to do the math logics you want, which means they can be called from anywhere, without instancing an object.

If you need persistent variable storage over time, so it can’t be just a single blueprint node, then yes, adding an object to handle all of your math logic is viable, I have a tutorial related to that here:

UObjects for fancy C++ Code

> [@Best method to pump online systems](https://forums.unrealengine.com/t/best-method-to-pump-online-systems/270464/5):
>
> @SMR Hi again! Advance Notice = zap zap zap VICTORY!!! zap zap zapThe part I was puzzling over is that you want a tick function, but don’t necessarily have an active UWorld, because levels could be up or down. I ran some tests using GameInstance + a UObject BP rainbow I am very happy to report rainbow That GameInstance can Run Timers That Last In-Between Level Changes \< ~~~~~~ sparkling_heart star2 sparkling_heart (“OMG!” -Rama) ~ Yes!!! These Timers Will zap Cont…

1. I do recommend using a plugin even for your uobject class, which you can just add to your BP Library plugin somewheres. Reason: You could eventually add your plugin to the marketplace, and especially in UE5, plugins compile VERY fast, and even within Epic, many projects, I’ve observed, have tended to start using plugins for different aspects of a larger project.

So Plugins are very much the

🌈 💥 🌷 ✨ Hot Pink Sparkly Rainbow of Excitement 🌈 💥 🌷 ✨

These days, in the UE World…

(The only ⚡ Real ⚡ World)!

Enjoy!

💖

Rama
