I have been working a bit with AI for a project but have an issue with trying to set values on the AI’s sight config on the AI perception component of the AI. Every time i try to set a value the client crashes and gives me this crash report.
I have the code where i create the config below.
Any help would be appreciated, i have been testing a bit but cannot figure out why it is crashing for me.
MachineId:
EpicAccountId:
Access violation - code c0000005 (first/second chance not available)
""
UE4Editor_PropertyEditor!FPropertyNode::PropagatePropertyChange() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\propertyeditor\private\propertynode.cpp:2390]
UE4Editor_PropertyEditor!FPropertyValueImpl::ImportText() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\propertyeditor\private\propertyhandleimpl.cpp:426]
UE4Editor_PropertyEditor!FPropertyValueImpl::ImportText() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\propertyeditor\private\propertyhandleimpl.cpp:297]
UE4Editor_PropertyEditor!FPropertyHandleFloat::SetValue() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\propertyeditor\private\propertyhandleimpl.cpp:2160]
UE4Editor_PropertyEditor!SPropertyEditorNumeric<float>::OnValueCommitted() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\editor\propertyeditor\private\userinterface\propertyeditor\spropertyeditornumeric.h:254]
UE4Editor_PropertyEditor!TBaseSPMethodDelegateInstance<0,SPropertyEditorNumeric<float>,0,TTypeWrapper<void> __cdecl(float,enum ETextCommit::Type)>::Execute() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:282]
UE4Editor_PropertyEditor!TBaseSPMethodDelegateInstance<0,SPropertyEditorNumeric<float>,0,void __cdecl(float,enum ETextCommit::Type)>::ExecuteIfSafe() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:388]
UE4Editor_PropertyEditor!SSpinBox<float>::CommitValue() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\public\widgets\input\sspinbox.h:614]
UE4Editor_PropertyEditor!SSpinBox<float>::TextField_OnTextCommitted() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\public\widgets\input\sspinbox.h:544]
UE4Editor_PropertyEditor!TBaseSPMethodDelegateInstance<0,SSpinBox<float>,0,TTypeWrapper<void> __cdecl(FText const & __ptr64,enum ETextCommit::Type)>::Execute() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:282]
UE4Editor_PropertyEditor!TBaseSPMethodDelegateInstance<0,SSpinBox<float>,0,void __cdecl(FText const & __ptr64,enum ETextCommit::Type)>::ExecuteIfSafe() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:388]
UE4Editor_Slate!SEditableText::OnEnter() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\widgets\input\seditabletext.cpp:973]
UE4Editor_Slate!FTextEditHelper::OnKeyDown() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\text\textedithelper.cpp:191]
UE4Editor_Slate!SEditableText::OnKeyDown() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\widgets\input\seditabletext.cpp:1637]
UE4Editor_Slate!<lambda_4f604f87f3ce3f5c3b6a1447676ad634>::operator()() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:3750]
UE4Editor_Slate!FEventRouter::Route<FReply,FEventRouter::FBubblePolicy,FKeyEvent,<lambda_4f604f87f3ce3f5c3b6a1447676ad634> >() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:212]
UE4Editor_Slate!FEventRouter::RouteAlongFocusPath<FEventRouter::FBubblePolicy,<lambda_4f604f87f3ce3f5c3b6a1447676ad634>,FKeyEvent>() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:194]
UE4Editor_Slate!FSlateApplication::ProcessKeyDownEvent() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:3751]
UE4Editor_Slate!FSlateApplication::OnKeyDown() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:3675]
UE4Editor_Core!FWindowsApplication::ProcessDeferredMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsapplication.cpp:1262]
UE4Editor_Core!FWindowsApplication::DeferMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsapplication.cpp:1711]
UE4Editor_Core!FWindowsApplication::ProcessMessage() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsapplication.cpp:706]
UE4Editor_Core!FWindowsApplication::AppWndProc() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsapplication.cpp:628]
user32
user32
UE4Editor_Core!FWindowsPlatformMisc::PumpMessages() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\core\private\windows\windowsplatformmisc.cpp:792]
UE4Editor!FEngineLoop::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\launch\private\launchengineloop.cpp:2319]
UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.8\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
I assume that it is because of how i created the sight config in my C++ since it is giving me access violation.
This is how i create the AI perception and the sight config.
In my controller header.
public:
// AI Perception component used for sensing actors
UPROPERTY(EditAnywhere, Category = "AI Sensing")
UAIPerceptionComponent* PerceptionComp;
UPROPERTY(EditAnywhere, Category = "AI Sensing")
UAISenseConfig_Sight* SightConfig;
In the constructor
// Setup the perception component
PerceptionComp = ObjectInitializer.CreateDefaultSubobject<UAIPerceptionComponent>(this, TEXT("AIPerception Component"));
SightConfig = ObjectInitializer.CreateDefaultSubobject<UAISenseConfig_Sight>(this, TEXT("Sight Config"));
PerceptionComp->ConfigureSense(*SightConfig);
PerceptionComp->SetDominantSense(SightConfig->GetSenseImplementation());
PerceptionComp->OnPerceptionUpdated.AddDynamic(this, &AMurdererController::AISense);
and in the OnPosses function.
// Setting values of AI perception component configs
SightConfig->SightRadius = ControlledPawn->SightRange;
SightConfig->LoseSightRadius = ControlledPawn->LoseSightRange;
SightConfig->PeripheralVisionAngleDegrees = ControlledPawn->PeripheralVisionAngle;
SightConfig->DetectionByAffiliation.bDetectEnemies = true;
SightConfig->DetectionByAffiliation.bDetectNeutrals = true;
SightConfig->DetectionByAffiliation.bDetectFriendlies = true;
PerceptionComp->ConfigureSense(*SightConfig);