Created
August 23, 2018 10:16
Star
You must be signed in to star a gist
[End Result] Classic Camera C++ - PlayerCharacter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fill out your copyright notice in the Description page of Project Settings. | |
#pragma once | |
#include "CoreMinimal.h" | |
#include "GameFramework/Character.h" | |
#include "PlayerCharacter.generated.h" | |
UCLASS() | |
class CLASSICCAMERATUT_API APlayerCharacter : public ACharacter | |
{ | |
GENERATED_BODY() | |
public: | |
// Sets default values for this character's properties | |
APlayerCharacter(); | |
protected: | |
// Called when the game starts or when spawned | |
virtual void BeginPlay() override; | |
public: | |
// Called every frame | |
virtual void Tick(float DeltaTime) override; | |
// Called to bind functionality to input | |
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; | |
// Movement Functions | |
void MoveForward(float InputAxis); | |
void Turn(float InputAxis); | |
void StartSprint(); | |
void StopSprint(); | |
// Properties | |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Movement") | |
float TurnAmount; | |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Movement") | |
float WalkSpeed = 125.0f; | |
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Character Movement") | |
float RunSpeed = 500.0f; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment