Advertisement
Shiny_

Untitled

Dec 3rd, 2023 (edited)
978
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.55 KB | None | 0 0
  1. // LD_Character.h
  2.  
  3. #pragma once
  4.  
  5. #include "CoreMinimal.h"
  6. #include "GameFramework/Character.h"
  7. #include "LD_Character.generated.h"
  8.  
  9. UCLASS()
  10. class LD_API ALD_Character : public ACharacter // TY KURWO JEBANA
  11. {
  12.     GENERATED_BODY()
  13.  
  14. public:
  15.     // Sets default values for this character's properties
  16.     ALD_Character();
  17.  
  18. protected:
  19.     // Called when the game starts or when spawned
  20.     virtual void BeginPlay() override;
  21.  
  22.     // Variables
  23.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Character Movement")
  24.     bool bIsSprinting;
  25.  
  26.     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Character Movement")
  27.     float CurrentSprintDuration;
  28.  
  29.     UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Character Movement")
  30.     float SprintStartTime;
  31.  
  32.     UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Character Movement")
  33.     float MaxSprintDuration;
  34.  
  35.     UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Character Movement")
  36.     float WalkSpeed;
  37.  
  38.     UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Character Movement")
  39.     float SprintSpeed;
  40.  
  41.     // Functions
  42.     UFUNCTION(BlueprintCallable, Category = "Character Movement")
  43.     void UpdateSprintSpeed(); // No need for parameters if we're calling on `self`
  44.  
  45.     ALD_Character* SelfReference;
  46. public:
  47.     // Called every frame
  48.     virtual void Tick(float DeltaTime) override;
  49.  
  50.     // Called to bind functionality to input
  51.     virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
  52. };
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement