Hello dear community
I’ve been following a tutorial on udemy about “Create Multiplayer Game With C++” and the using version is 4.17.2 since mine is the 4.20
so when i write the codes after compile it shows me this error:
error c2062: ‘value’: undeclared indentifier:
and i have no idea what should i do?
these are the codes i used:
[SPOILER] #pragma once
#include “CoreMinimal.h”
#include “GameFramework/Character.h”
#include “SCharacter.generated.h”
UCLASS()
class COOPGAME_API ASCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character’s properties
ASCharacter();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
void MoveForward(float Value);
void MoveRight(float value);
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
};
[/SPOILER]
[SPOILER] // Sets default values
ASCharacter::ASCharacter()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don’t need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void ASCharacter::BeginPlay()
{
Super::BeginPlay();
}
void ASCharacter::MoveForward(float value)
{
AddMovementInput(GetActorForwardVector() * value);
}
void ASCharacter::MoveRight(float value)
{
AddMovementInput(GetActorRightVector()* Value);
}
// Called every frame
void ASCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void ASCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis("MoveForward", this, &ASCharacter::MoveForward);
PlayerInputComponent->BindAxis("MoveRight", this, &ASCharacter::MoveRight);
}
[/SPOILER]