feat: rifle animations (in progress)
Added some rifle animations Added weapon socket
This commit is contained in:
parent
e5fc180630
commit
83aef1574c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Models/T-Pose/Animations/RifleNonAiming/RifleIdle.uasset
Normal file
BIN
Content/Models/T-Pose/Animations/RifleNonAiming/RifleIdle.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -116,14 +116,17 @@ void UShootingComponent::PickUpGun(UStaticMeshComponent* PickedGunMesh)
|
|||
DropGun();
|
||||
|
||||
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, EAttachmentRule::SnapToTarget,
|
||||
EAttachmentRule::KeepRelative, true);
|
||||
EAttachmentRule::KeepWorld, true);
|
||||
|
||||
PickedGunMesh->SetSimulatePhysics(false);
|
||||
PickedGunMesh->SetCastShadow(false);
|
||||
PickedGunMesh->AttachToComponent(PlayerCharacter->Weapon, AttachmentRules, FName(TEXT("GripPoint")));
|
||||
PickedGunMesh->AttachToComponent(PlayerCharacter->GetMesh(), AttachmentRules, FName(TEXT("GripPoint")));
|
||||
|
||||
AGunBase* PickedGunBase = Cast<AGunBase>(PickedGunMesh->GetOwner());
|
||||
|
||||
// Tymczasowo
|
||||
bHasRifle = true;
|
||||
|
||||
if (IsValid(CurrentGunBase))
|
||||
{
|
||||
SecondaryGunBase = PickedGunBase;
|
||||
|
|
@ -176,13 +179,16 @@ void UShootingComponent::DropGun()
|
|||
StopAiming();
|
||||
|
||||
FDetachmentTransformRules DetachmentRules(EDetachmentRule::KeepRelative, EDetachmentRule::KeepRelative,
|
||||
EDetachmentRule::KeepRelative, false);
|
||||
EDetachmentRule::KeepWorld, false);
|
||||
|
||||
CurrentGunMesh->DetachFromComponent(DetachmentRules);
|
||||
CurrentGunMesh->SetSimulatePhysics(true);
|
||||
CurrentGunMesh->bCastDynamicShadow = true;
|
||||
CurrentGunMesh->CastShadow = true;
|
||||
|
||||
// Tymczasowo
|
||||
bHasRifle = false;
|
||||
|
||||
CurrentGunMesh = nullptr;
|
||||
CurrentGunBase = nullptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,13 +33,6 @@ AExoPlayerCharacter::AExoPlayerCharacter()
|
|||
InteractionComponent = CreateDefaultSubobject<UInteractionComponent>(TEXT("Interaction Component"));
|
||||
ShootingComponent = CreateDefaultSubobject<UShootingComponent>(TEXT("Shooting Component"));
|
||||
|
||||
Weapon = CreateDefaultSubobject<USkeletalMeshComponent>("Weapon");
|
||||
Weapon->SetupAttachment(GetMesh());
|
||||
Weapon->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
Weapon->bCastDynamicShadow = false;
|
||||
Weapon->CastShadow = false;
|
||||
Weapon->SetRelativeLocation(FVector(-50.f, 0.f, -90.f));
|
||||
|
||||
//bUseControllerRotationPitch = false;
|
||||
//bUseControllerRotationYaw = true;
|
||||
//bUseControllerRotationRoll = false;
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@ public:
|
|||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Mele Attack")
|
||||
float MeleRange = 75.f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Shooting")
|
||||
bool bHasRifle = false;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Shooting")
|
||||
AThrowableBase* ThrowableItem = nullptr;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,6 @@ public:
|
|||
AExoPlayerCharacter();
|
||||
|
||||
/// U PROPERTIES ///
|
||||
UPROPERTY(EditAnywhere, Category = "Combat")
|
||||
TObjectPtr<USkeletalMeshComponent> Weapon;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
|
||||
TObjectPtr<UInteractionComponent> InteractionComponent;
|
||||
|
||||
|
|
@ -60,8 +57,8 @@ public:
|
|||
UPROPERTY(EditAnywhere, Category = "Movement Properties")
|
||||
float CrouchSpeed = 300.f;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Aiming")
|
||||
float bIsAimingMode = false;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Aiming")
|
||||
bool bIsAimingMode = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Crouch")
|
||||
bool bIsCrouchingMode = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user