Skip to content

Commit

Permalink
BT92 Radial Forces & Caching.cmproj
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Tristem committed Jul 29, 2016
1 parent 9f2bf90 commit 44390db
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
Binary file modified BattleTank/Content/Projectile/Projectile_BP.uasset
Binary file not shown.
Binary file modified BattleTank/Content/Tank/Tank_BP.uasset
Binary file not shown.
Binary file modified BattleTank/Content/_Levels/BattleGround.umap
Binary file not shown.
6 changes: 5 additions & 1 deletion BattleTank/Source/BattleTank/Private/Projectile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ AProjectile::AProjectile()
CollisionMesh->SetVisibility(false);

LaunchBlast = CreateDefaultSubobject<UParticleSystemComponent>(FName("Launch Blast"));
LaunchBlast->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform); // TODO update to new API
LaunchBlast->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);

ProjectileMovement = CreateDefaultSubobject<UProjectileMovementComponent>(FName("Projectile Movement"));
ProjectileMovement->bAutoActivate = false;

ImpactBlast = CreateDefaultSubobject<UParticleSystemComponent>(FName("Impact Blast"));
ImpactBlast->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
ImpactBlast->bAutoActivate = false;

ExplosionForce = CreateDefaultSubobject<URadialForceComponent>(FName("Explosion Force"));
ExplosionForce->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
}

// Called when the game starts or when spawned
Expand All @@ -43,4 +46,5 @@ void AProjectile::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, U
{
LaunchBlast->Deactivate();
ImpactBlast->Activate();
ExplosionForce->FireImpulse();
}
3 changes: 3 additions & 0 deletions BattleTank/Source/BattleTank/Public/Projectile.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ class BATTLETANK_API AProjectile : public AActor

UPROPERTY(VisibleAnywhere, Category = "Components")
UParticleSystemComponent* ImpactBlast = nullptr;

UPROPERTY(VisibleAnywhere, Category = "Components")
URadialForceComponent* ExplosionForce = nullptr;
};

0 comments on commit 44390db

Please sign in to comment.