Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // LD_Character.h
- #pragma once
- #include "CoreMinimal.h"
- #include "GameFramework/Character.h"
- #include "LD_Character.generated.h"
- UCLASS()
- class LD_API ALD_Character : public ACharacter // TY KURWO JEBANA
- {
- GENERATED_BODY()
- public:
- // Sets default values for this character's properties
- ALD_Character();
- protected:
- // Called when the game starts or when spawned
- virtual void BeginPlay() override;
- // Variables
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Character Movement")
- bool bIsSprinting;
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Character Movement")
- float CurrentSprintDuration;
- UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Character Movement")
- float SprintStartTime;
- UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Character Movement")
- float MaxSprintDuration;
- UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Character Movement")
- float WalkSpeed;
- UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Character Movement")
- float SprintSpeed;
- // Functions
- UFUNCTION(BlueprintCallable, Category = "Character Movement")
- void UpdateSprintSpeed(); // No need for parameters if we're calling on `self`
- ALD_Character* SelfReference;
- public:
- // Called every frame
- virtual void Tick(float DeltaTime) override;
- // Called to bind functionality to input
- virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement