Add Niagara Component to Swarm Agents

This commit is contained in:
baz 2025-07-23 22:10:41 +01:00
parent ee0694bddd
commit 5e2028c529
4 changed files with 14 additions and 2 deletions

BIN
Content/Weapons/Swarm/BP_SwarmAgent.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Weapons/Swarm/NS_SwarmAgent.uasset (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -6,6 +6,7 @@
#include "Components/SphereComponent.h"
#include "vampires/EnemyCharacter.h"
#include "vampires/HealthComponent.h"
#include "NiagaraComponent.h"
#include "vampires/Weapon.h"
@ -22,6 +23,10 @@ ASwarmAgent::ASwarmAgent()
StaticMeshComponent->SetEnableGravity(false);
StaticMeshComponent->SetGenerateOverlapEvents(false);
StaticMeshComponent->SetCollisionProfileName(TEXT("NoCollision"));
NiagaraComponent = CreateDefaultSubobject<UNiagaraComponent>(TEXT("Niagara Component"));
NiagaraComponent->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
NiagaraComponent->DeactivateImmediate();
}
// Called when the game starts or when spawned

View File

@ -6,6 +6,7 @@
#include "GameFramework/Actor.h"
#include "SwarmAgent.generated.h"
class UNiagaraComponent;
class USphereComponent;
UCLASS()
@ -20,6 +21,9 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TObjectPtr<UStaticMeshComponent> StaticMeshComponent = nullptr;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
TObjectPtr<UNiagaraComponent> NiagaraComponent = nullptr;
// Sets default values for this actor's properties
ASwarmAgent();