# circular dependency with arrays of devices

**URL:** <https://forums.unrealengine.com/t/circular-dependency-with-arrays-of-devices/1175971>\
**Category:** UEFN\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [May 23, 2023, 3:17pm UTC](https://forums.unrealengine.com/t/circular-dependency-with-arrays-of-devices/1175971 "2023-05-23T15:17:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GordonStraylight](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GordonStraylight](https://forums.unrealengine.com/u/GordonStraylight)\
**Post date:** [May 23, 2023, 3:17pm UTC](https://forums.unrealengine.com/t/circular-dependency-with-arrays-of-devices/1175971/1 "2023-05-23T15:17:01Z")

</div>

Just getting to the end of a project and I have a question about circular dependency.  
We have a complex game with lots of interacting devices. I have just realised quite a lot of it has been structured with what should be circular dependency but the compiler has been fine with it.

This is where a device class has an editable array of devices which in turn reference the original device class. The compiler wouldn’t allow these two device classes to reference each other but for some reason it allows it with editable arrays of devices.

The reason i have noticed it now is that in a recent update something must have been added to check for this and its causing a lot of lag when selecting these devices.

My question is if this is a loop hole that is going to be closed in the future? I hope we can get some official information on this so we know if we have to do quite a major restructure or not.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [May 23, 2023, 7:11pm UTC](https://forums.unrealengine.com/t/circular-dependency-with-arrays-of-devices/1175971/2 "2023-05-23T19:11:18Z")

</div>

To get rid of circular dependencies use forward declarations for properties that have circular dependencies and include that classes header in the cpp. Same for structs.

---

<div class="post-metadata">

**Author:** ![GordonStraylight](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GordonStraylight](https://forums.unrealengine.com/u/GordonStraylight)\
**Post date:** [May 23, 2023, 7:20pm UTC](https://forums.unrealengine.com/t/circular-dependency-with-arrays-of-devices/1175971/3 "2023-05-23T19:20:01Z")

</div>

Hey man thanks, this is for uefn verse not C++ unfortunately. No forward declarations im afraid.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [May 23, 2023, 7:40pm UTC](https://forums.unrealengine.com/t/circular-dependency-with-arrays-of-devices/1175971/4 "2023-05-23T19:40:22Z")

</div>

@GordonStraylight Please create the thread in the Fortnite UEFN section of the forum in the future. This is the main Unreal Engine forum.

No harm, it’s just confusing when it’s in the main Unreal Engine segment.

---

<div class="post-metadata">

**Author:** ![GordonStraylight](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GordonStraylight](https://forums.unrealengine.com/u/GordonStraylight)\
**Post date:** [May 23, 2023, 7:59pm UTC](https://forums.unrealengine.com/t/circular-dependency-with-arrays-of-devices/1175971/5 "2023-05-23T19:59:37Z")

</div>

Are you sure? I do actually really need help with this so if its in the wrong forum that would be annoying.

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [May 23, 2023, 8:00pm UTC](https://forums.unrealengine.com/t/circular-dependency-with-arrays-of-devices/1175971/6 "2023-05-23T20:00:43Z")

</div>

I’m pretty sure you’ll get better help with people focused purely on UEFN 🙂
