Add Niagara Component to Swarm Agents
This commit is contained in:
parent
ee0694bddd
commit
5e2028c529
BIN
Content/Weapons/Swarm/BP_SwarmAgent.uasset
(Stored with Git LFS)
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
BIN
Content/Weapons/Swarm/NS_SwarmAgent.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user