Slightly improved bullet trails fx
This commit is contained in:
parent
1bab3ec0ab
commit
1e3baeb391
BIN
Content/Legumix/Weapon/Ammo/BP_Tracer.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Weapon/Ammo/BP_Tracer.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Weapon/Ammo/C_Jitter.uasset
(Stored with Git LFS)
Normal file
BIN
Content/Legumix/Weapon/Ammo/C_Jitter.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Legumix/Weapon/Ammo/FXE_ShotGun_Trail.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Weapon/Ammo/FXE_ShotGun_Trail.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Weapon/Revolver/BP_Revolver.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Weapon/Revolver/BP_Revolver.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Weapon/Shotgun/BP_Shotgun.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Weapon/Shotgun/BP_Shotgun.uasset
(Stored with Git LFS)
Binary file not shown.
@ -24,8 +24,11 @@ void ALMBulletTracer::Tick(float DeltaTime)
|
||||
Super::Tick(DeltaTime);
|
||||
}
|
||||
|
||||
void ALMBulletTracer::Initialize(const FVector& Vector)
|
||||
void ALMBulletTracer::Initialize(const FVector& Vector, const FRotator& Direction, USceneComponent* Origin)
|
||||
{
|
||||
SetActorLocationAndRotation(Origin->GetComponentLocation(), Direction);
|
||||
TrailOrigin = Origin;
|
||||
|
||||
const double Distance = FVector::Distance(Vector, GetActorLocation());
|
||||
float const LifeTime = Distance / Speed;
|
||||
|
||||
|
@ -78,8 +78,7 @@ void ULMWeaponManager::CreateTracer(const EAmmoType Ammo, const FVector EndLocat
|
||||
|
||||
if (ALMBulletTracer* Trace = GetWorld()->SpawnActor<ALMBulletTracer>(Data.BulletTracer))
|
||||
{
|
||||
Trace->SetActorLocationAndRotation(GetCurrentWeapon()->GetTracerOrigin(), Direction);
|
||||
Trace->Initialize(EndLocation);
|
||||
Trace->Initialize(EndLocation, Direction, GetCurrentWeapon()->TracerOrigin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public:
|
||||
void BeginPlay() override;
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
void Initialize(const FVector& Vector);
|
||||
void Initialize(const FVector& Vector, const FRotator& Direction, USceneComponent* Origin);
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, Category=Legumix)
|
||||
void DestinationReached();
|
||||
@ -49,6 +49,9 @@ private:
|
||||
UPROPERTY(BlueprintReadWrite, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||
bool bCanMove;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||
TObjectPtr<USceneComponent> TrailOrigin;
|
||||
|
||||
private:
|
||||
FTimerHandle TimerHandle;
|
||||
};
|
||||
|
@ -47,9 +47,6 @@ public:
|
||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||
void OnDefaultReload();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
FVector GetTracerOrigin() const { return TracerOrigin->GetComponentLocation(); }
|
||||
|
||||
protected:
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void AllowRefire();
|
||||
@ -62,6 +59,9 @@ public:
|
||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadWrite, Category="Legumix|Weapon")
|
||||
EWeaponState State;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||
TObjectPtr<USceneComponent> TracerOrigin;
|
||||
|
||||
protected: /* Weapon Data */
|
||||
FTimerHandle FireTimer;
|
||||
FTimerHandle ReloadTimer;
|
||||
@ -134,8 +134,5 @@ private: /* Components */
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||
TObjectPtr<USkeletalMeshComponent> WeaponMesh;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||
TObjectPtr<USceneComponent> TracerOrigin;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user