# PCG Custom graph inheritance

**URL:** <https://forums.unrealengine.com/t/pcg-custom-graph-inheritance/1578708>\
**Category:** C++\
**Tags:** Procedural-Generation, unreal-engine, procedural, custom-nodes, question, CPP\
**Created:** [January 1, 2024, 12:12pm UTC](https://forums.unrealengine.com/t/pcg-custom-graph-inheritance/1578708 "2024-01-01T12:12:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zssork](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zssork/32/629783_2.png) [@Zssork](https://forums.unrealengine.com/u/Zssork)\
**Post date:** [January 1, 2024, 12:12pm UTC](https://forums.unrealengine.com/t/pcg-custom-graph-inheritance/1578708/1 "2024-01-01T12:12:04Z")

</div>

Hi, is there a way to use inheritance with PCG graphs? I want to leverage the advantages of PCG graphs but have some sorft of inheritance for it. The reason is that i have have always similar parameters and inputs for my graphs and the same nodes at the start. I set the parameters using c++. I could just always copy paste them but that sounds not like a good idear … what if i want to change them? I would need to adjust all the graphs … so is there any way to create like a custom type of graph with predefined inputs or make a subgraph as parameter or something like that (I would be fine to do this in c++ aswell if needed)? Here is an example of the my pcg graph:

 ![grafik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/a/08a7646dfbf3881ede6bc83c14e69fdff2e0c99a.png)

---

<div class="post-metadata">

**Author:** ![HeellessAchillez](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HeellessAchillez](https://forums.unrealengine.com/u/HeellessAchillez)\
**Post date:** [January 6, 2024, 3:34pm UTC](https://forums.unrealengine.com/t/pcg-custom-graph-inheritance/1578708/2 "2024-01-06T15:34:46Z")

</div>

Did you solve your issue? 🙂

I did a quick test and it is possible to inherit from `UPCGGraph` but I’m not sure what to do after that - doesn’t seem to be any obvious way to create graphs from that.

What you could do is perhaps to collect your parameters in a struct and include that. Then you could process them in a custom PCG node (which I think you can do in c++ or blueprints) and then do whatever you want after that.

You would still have to duplicate the struct and the custom node, but I think duplicating two are better than 10+.

Hope it helps!

---

<div class="post-metadata">

**Author:** ![Zssork](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zssork/32/629783_2.png) [@Zssork](https://forums.unrealengine.com/u/Zssork)\
**Post date:** [January 9, 2024, 1:05pm UTC](https://forums.unrealengine.com/t/pcg-custom-graph-inheritance/1578708/3 "2024-01-09T13:05:05Z")

</div>

thank you for the reply. I solved it similar to your suggestion. I created a DataAsset and used that to configure and have it be passed into the PCG grapth by parameter. Currently im not using a PCG graph for every asset any more. So for now im only using PCG in the background and configure everything in the DataAsset. For the PCG graph i had to create a custom Node in C++ that would create/assign meshes to the points.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 8, 2024, 1:05pm UTC](https://forums.unrealengine.com/t/pcg-custom-graph-inheritance/1578708/4 "2024-02-08T13:05:32Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
