勉強したこと
Gun.hで
/// Indicates that this property can be edited by property windows in the editor EditAnywhere,
/////このプロパティがエディタのプロパティウィンドウで編集できることを示します
スポーンするものはポインタで。
UPROPERTY(EditAnyWhere)
UParticleSystem* MuzzleFlash;
Gun.cppで
//簡単な方法
static UParticleSystemComponent* SpawnEmitterAttached(class UParticleSystem* EmitterTemplate, class USceneComponent* AttachToComponent, FName AttachPointName = NAME_None);
// Backwards compatible version of SpawnEmitterAttached for C++ without Scale
//スケールなしのC ++用のSpawnEmitterAttachedの下位互換バージョン
//デフォルト引数がなくて多く使いずらいもの
static UParticleSystemComponent* SpawnEmitterAttached(class UParticleSystem* EmitterTemplate, class USceneComponent* AttachToComponent, FName AttachPointName, FVector Location, FRotator Rotation, EAttachLocation::Type LocationType);
#include "Kismet/GameplayStatics.h"
UGameplayStatics::SpawnEmitterAttached(MuzzleFlash, Mesh, TEXT("MuzzleFlashSocket"));
そしたらエディタでエミッタを設定する

コメント