현재 블루프린트로 만든 파티클을
특정 상황에서 생성되게 만들어야 하는데
인터넷에서 찾아본 결과 블루프린트를 월드에 스폰 하려면
.h
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = SmartSafety, meta = (AllowPrivateAccess = “true”))
TSubclassOf<AActor> m_ElectriShokeEffect;
추가 하고
.cpp
생성자에선
static ConstructorHelpers::FObjectFinder<UBlueprint> PutNameHere(TEXT("/Game/SmartSafety/VisualEffect/vfxsparkpack/Blueprint/BP_ElectricalBurst"));
if (PutNameHere.Object)
{
m_ElectriShokeEffect = (UClass*)PutNameHere.Object->GeneratedClass;
}
를 추가하고
void Envent()
{
m_ElectriShokeEffect->GetWorld()->SpawnActor<AActor>(m_ElectriShokeEffect,this->GetTransform().GetLocation() , FRotator(0, 0, 0));
}
을 추가하였는데 크러쉬가 나면서 엔진이 꺼집니다.
m_ElectriShokeEffect 가 null이라 꺼지는 것을 의심해봤으나 디버그 찍어본 결과 그러진 않고
다른 이유인것 같은데 무슨 이유인지 잘 모르겠네요 ㅠㅠ