C++ created Perception Component crash editor

I create AI controller with UAIPerceptionComponent via C++. When I build project there are no any trouble with compilation. After that I create BP inherited from this AIController and try to tweak some values of Sense Config. But it fails because of engine crash. I’ve tried on empty project - same result. Please help!!! =-\

UPD: Creating AIController and attaching Perception Component to this controller via Blueprint Editor doesn’t cause this issue

UPD 2: Debugger says that ActualObjToChange is NULL (Engine\Source\Editor\PropertyEditor\Private\PropertyNode.cpp at 2400 line)

//// PerceptionTest.h
    #pragma once
    #include "AIController.h"
    #include "Perception/AIPerceptionSystem.h"
    #include "Perception/AIPerceptionComponent.h"
    #include "Perception/AISenseConfig_Sight.h"
    #include "PerceptionTest.generated.h"
    class MYPROJECT_API APerceptionTest : public AAIController
    	APerceptionTest(const FObjectInitializer& ObjectInitializer);
    	UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category = "Test")
    		UAIPerceptionComponent* PerceptionComp;
    	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Test")
    		UAISenseConfig_Sight* SightConfig;
    //// PerceptionTest.cpp
    #include "MyProject.h"
    #include "PerceptionTest.h"
    APerceptionTest::APerceptionTest(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
    	PerceptionComp = ObjectInitializer.CreateDefaultSubobject<UAIPerceptionComponent>(this, "Perception Comp");
    	SightConfig = CreateDefaultSubobject<UAISenseConfig_Sight>("Sight Sense");
    	SightConfig->DetectionByAffiliation.bDetectEnemies = true;
    	SightConfig->DetectionByAffiliation.bDetectFriendlies = true;
    	SightConfig->DetectionByAffiliation.bDetectNeutrals = true;
    	SightConfig->PeripheralVisionAngleDegrees = 65.f;
    	SightConfig->SightRadius = 1000.f;
    	SightConfig->LoseSightRadius = 1500.f;

Can you show me the callstack?

@Bino Here you are

Tough to work out from here. This seems the most positive answer I could find Client crashes when i try to set values on my sight config in my AI controller BP - AI - Unreal Engine Forums

@Bino I’ll try this out, but I think this is very rough workaround. As I can understand, issue I described is UI related, not AI or Perception

Hey napolinkinpark3r-

I expereienced the crash you described and have submitted a report for investigation (UE-27729). The crash is tied to defining the UAISenseConfig_Sight in code. If you remove the lines related to UAISenseConfig_Sight and SightConfig from the .h and .cpp and instead set these values through the editor you should be able to avoid the crash.


Doug Wilson

Thanks for reply, Doug.
I should add remark that crash caused not only by Sight Sense configuration, but by other senses too (Hearing, Damage etc).
Hope this issue will be fixed soon =-)

Hey napolinkinpark3r-

I found that this crash is fixed in 4.11 and is already included in the current 4.11 Preview 6 available on the Launcher. If you open a copy of your project in this version you should be able to use your current code setup without getting a crash.