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);
|
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());
|
const double Distance = FVector::Distance(Vector, GetActorLocation());
|
||||||
float const LifeTime = Distance / Speed;
|
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))
|
if (ALMBulletTracer* Trace = GetWorld()->SpawnActor<ALMBulletTracer>(Data.BulletTracer))
|
||||||
{
|
{
|
||||||
Trace->SetActorLocationAndRotation(GetCurrentWeapon()->GetTracerOrigin(), Direction);
|
Trace->Initialize(EndLocation, Direction, GetCurrentWeapon()->TracerOrigin);
|
||||||
Trace->Initialize(EndLocation);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ public:
|
|||||||
void BeginPlay() override;
|
void BeginPlay() override;
|
||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
|
|
||||||
void Initialize(const FVector& Vector);
|
void Initialize(const FVector& Vector, const FRotator& Direction, USceneComponent* Origin);
|
||||||
public:
|
public:
|
||||||
UFUNCTION(BlueprintCallable, Category=Legumix)
|
UFUNCTION(BlueprintCallable, Category=Legumix)
|
||||||
void DestinationReached();
|
void DestinationReached();
|
||||||
@ -48,6 +48,9 @@ private:
|
|||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, Category=Legumix, meta=(AllowPrivateAccess=true))
|
UPROPERTY(BlueprintReadWrite, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||||
bool bCanMove;
|
bool bCanMove;
|
||||||
|
|
||||||
|
UPROPERTY(BlueprintReadWrite, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||||
|
TObjectPtr<USceneComponent> TrailOrigin;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FTimerHandle TimerHandle;
|
FTimerHandle TimerHandle;
|
||||||
|
@ -46,9 +46,6 @@ public:
|
|||||||
|
|
||||||
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
|
||||||
void OnDefaultReload();
|
void OnDefaultReload();
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
|
||||||
FVector GetTracerOrigin() const { return TracerOrigin->GetComponentLocation(); }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
@ -61,6 +58,9 @@ public:
|
|||||||
/** The current state of the weapon. */
|
/** The current state of the weapon. */
|
||||||
UPROPERTY(VisibleInstanceOnly, BlueprintReadWrite, Category="Legumix|Weapon")
|
UPROPERTY(VisibleInstanceOnly, BlueprintReadWrite, Category="Legumix|Weapon")
|
||||||
EWeaponState State;
|
EWeaponState State;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||||
|
TObjectPtr<USceneComponent> TracerOrigin;
|
||||||
|
|
||||||
protected: /* Weapon Data */
|
protected: /* Weapon Data */
|
||||||
FTimerHandle FireTimer;
|
FTimerHandle FireTimer;
|
||||||
@ -134,8 +134,5 @@ private: /* Components */
|
|||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true))
|
||||||
TObjectPtr<USkeletalMeshComponent> WeaponMesh;
|
TObjectPtr<USkeletalMeshComponent> WeaponMesh;
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true))
|
|
||||||
TObjectPtr<USceneComponent> TracerOrigin;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user