코드에서 블루프린트 생성에 대해 질문 드립니다

현재 블루프린트로 만든 파티클을

특정 상황에서 생성되게 만들어야 하는데

인터넷에서 찾아본 결과 블루프린트를 월드에 스폰 하려면

.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-&gt;GeneratedClass;

}

를 추가하고

void Envent()
{
m_ElectriShokeEffect->GetWorld()->SpawnActor<AActor>(m_ElectriShokeEffect,this->GetTransform().GetLocation() , FRotator(0, 0, 0));
}

을 추가하였는데 크러쉬가 나면서 엔진이 꺼집니다.

m_ElectriShokeEffect 가 null이라 꺼지는 것을 의심해봤으나 디버그 찍어본 결과 그러진 않고

다른 이유인것 같은데 무슨 이유인지 잘 모르겠네요 ㅠㅠ

First of all, If the actor is about only the particle emitter, I wouldn’t spawn a particle system as an actor.

Try this instead of the actor spawning.

Second, put one more line after exctly you spawn the actor ( and debug it that if it shows Nullptr or not, look at the dissassembled code. )

 If (!m_ElectriShokeEffect) return;

You didn’t describe about the debugging state, so my answer may not correct.
But code looks like very agressively instantiate the actor.