Hello! Soo I created a custom C++ BTService, but for some reason, it keeps removing itself from the editor after restarting it?
Once compiled:
http://puu.sh/oxoZN/f46c2b3743.png
and here’s after restarting the editor
http://puu.sh/oxp3J/a97a2a5233.png
I’ve also attached my code i have currently as well
DetectEnemy_Crawler.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "BehaviorTree/Services/BTService_BlackboardBase.h"
#include "DetectEnemy_Crawler.generated.h"
/**
*
*/
UCLASS()
class TEST_API UDetectEnemy_Crawler : public UBTService_BlackboardBase
{
GENERATED_BODY()
public:
UDetectEnemy_Crawler();
virtual void TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds) override;
};
DetectEnemy_Crawler.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "Test.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/Blackboard/BlackboardKeyAllTypes.h"
#include "CrawlerController.h"
#include "Crawler.h"
#include "DetectEnemy_Crawler.h"
UDetectEnemy_Crawler::UDetectEnemy_Crawler()
{
bCreateNodeInstance = true;
}
void UDetectEnemy_Crawler::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
{
Super::TickNode(OwnerComp, NodeMemory, DeltaSeconds);
ACrawlerController *CC = Cast<ACrawlerController>(OwnerComp.GetAIOwner());
if (CC != NULL)
{
ATargetPoint* Waypoint = Cast<ATargetPoint>(OwnerComp.GetBlackboardComponent()->GetValue<UBlackboardKeyType_Object>(CC->WaypointID));
if (Waypoint)
{
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Red, "Found!");
}
}
}
Any help would be super :(! such a strange thing to happen here