TArray of EditInlineNew subobjects that is Instanced does not hold references when a member of native subobject

This is a slight duplicate post but the title is more specific than the other’s here and here.

The easiest repro steps :

  1. Create a native AIPerceptionComponent on an AIcontroller in C++.
  2. Try to add items to the SensesConfig in a blueprint instance of that controller.
  3. Compile and see the references lost.

This doesn’t happen if the perception component is not created via an object initialize or in construction.

edit: Bug was present in promoted build of 1/8/2015

Hi ,

Could you provide some additional clarification for step 1? What is the code you are using to create the AIPerceptionComponent? I tried a simple setup to create that component and ran into a chain of build errors.

Your build settings need the AIModule.

header:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = “Behavior”)
class UAIPerceptionComponent* PerceptionComp;

in cpp:
#include “Perception/AIPerceptionComponent.h”

PerceptionComp = ObjectInitializer.CreateOptionalDefaultSubobject(this, TEXT(“PerceptionComp”));

I could have sworn that was how I had set it up previously, but now it is working. I am doing some checking on this now, and should have some more information for you soon.

Hi ,

I ran some tests with the setup you provided in our latest internal version and this specific issue does still appear to be occurring. I have submitted a ticket to have this investigated further (UE-8104).

The other issue that you linked is no longer occurring (I tested that again in the same test project I was using here), so there is something specific in this issue that was not corrected in the other fix.

One of our developers has expressed a little concern about the workaround you are using, however. He is worried that it may be potentially unsafe depending on where, when, and how you are adding the AIPerceptionController. Would you be able to elaborate on that?

I am going to close your other post regarding this issue as a duplicate so that we can focus on a single post.

For now I reverted my changes that created the sense configs in code. I’m using a perceptioncomponent that I add at blueprint time and not through native construction. Its fine for the perceptionComponent, but this bug def needs addressing for other situations. My team has at least two other components that we require to be constructed natively, but can’t due to this issue.

Thank you for that update. I changed up my test to use your workaround, and I expect that is perfectly fine. I am waiting for confirmation from the developer, but I’ll be surprised if there are any potential problems with doing it that way.

What are the other components that are giving you trouble?

Custom components I wrote.

The ticket that I had submitted was tested and closed out today. If you have built the Engine from source code, you can find the fix that was submitted here. If you are using the binary version of the Engine installed by the Launcher, the fix will be available when 4.7 is released. Please let us know if this does not also correct the issues with your custom components.

Thanks. I’ll try it out next time we can integrate/pull from promoted.

Hey -

We’ve not heard from you in a few days. Have you had the to test if the issue was fixed for you with the release of 4.7? For tracking purposes I am going to mark this as resolved however if you find that this problem is still occurring feel free to reopen this post and we will investigate further.

Cheers

I haven’t been able to test it yet as integrating the new branch isn’t safe for my team right now, but I checked out the changelists and it looks like it solved the problem. Sounds good for this to be resolved. I’ll pull a clean 4.7 post gdc.

Confirmed fixed.

We hope this Blueprint Class “EditInlinenNew” plugin (which no longer requires any C++ to use the EditInlinenNew feature) will help you. :100: