Added Sprint Basic Function and Binds To Shift Key
This commit is contained in:
parent
b9a8bf4f85
commit
08e7fcecba
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:467d285447b71f9b4417bde598153ef906f87de4d2244f0b3cbaac1b712d693b
|
||||
size 1360
|
BIN
EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Input/IMC_Default.uasset
(Stored with Git LFS)
Binary file not shown.
@ -134,6 +134,7 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent*
|
||||
|
||||
//Moving
|
||||
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Move);
|
||||
EnhancedInputComponent->BindAction(SprintAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Sprint);
|
||||
|
||||
//Looking
|
||||
EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::Look);
|
||||
@ -430,6 +431,17 @@ void AEndlessVendettaCharacter::StopFire()
|
||||
}
|
||||
}
|
||||
|
||||
void AEndlessVendettaCharacter::Sprint()
|
||||
{
|
||||
MoveGroundSpeed *= 2;
|
||||
// bIsPlayerSprinting = true;
|
||||
// if (bIsPlayerSprinting)
|
||||
// {
|
||||
// MoveGroundSpeed *= 2;
|
||||
// bIsPlayerSprinting = false;
|
||||
// }
|
||||
}
|
||||
|
||||
void AEndlessVendettaCharacter::GunRightClick()
|
||||
{
|
||||
if (IsValid(PrimaryWeapon) && !bIsScoped)
|
||||
|
@ -73,6 +73,9 @@ class AEndlessVendettaCharacter : public ACharacter
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
||||
UInputAction* InteractAction;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
||||
UInputAction* SprintAction;
|
||||
|
||||
public:
|
||||
AEndlessVendettaCharacter();
|
||||
|
||||
@ -114,6 +117,8 @@ public:
|
||||
|
||||
bool bIsPlayerMoving = false;
|
||||
|
||||
bool bIsPlayerSprinting = false;
|
||||
|
||||
double MoveGroundSpeed;
|
||||
|
||||
/** Look Input Action */
|
||||
@ -156,6 +161,8 @@ public:
|
||||
UFUNCTION(BlueprintCallable, Category = "Weapons")
|
||||
void StopFire();
|
||||
|
||||
void Sprint();
|
||||
|
||||
UArrowComponent* ScopedLocationArrow;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category = "Dont Touch")
|
||||
|
Loading…
Reference in New Issue
Block a user