circular dependency with arrays of devices

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.

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.

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

@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.

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

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