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"
/**
*
*/
UCLASS()
class MYPROJECT_API APerceptionTest : public AAIController
{
GENERATED_BODY()
public:
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");
PerceptionComp->ConfigureSense(*SightConfig);
PerceptionComp->SetDominantSense(SightConfig->GetSenseImplementation());
SightConfig->DetectionByAffiliation.bDetectEnemies = true;
SightConfig->DetectionByAffiliation.bDetectFriendlies = true;
SightConfig->DetectionByAffiliation.bDetectNeutrals = true;
SightConfig->PeripheralVisionAngleDegrees = 65.f;
SightConfig->SightRadius = 1000.f;
SightConfig->LoseSightRadius = 1500.f;
}