Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[End Result] Classic Camera C++ - PlayerCharacter.h
// 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
You can’t perform that action at this time.