Compiler giving me an error that im sure does not exist

the compiler says there is a missing semi colon on line 31, however there IS a semi colon,

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"

#include "GameFramework/Character.h"

#include "ShooterCharacter.generated.h"

class AGun;

UCLASS()

class SIMPLESHOOTER_API AShooterCharacter : public ACharacter

{

    GENERATED_BODY()

public:

    // Sets default values for this character's properties

    AShooterCharacter();

   

protected:

    // Called when the game starts or when spawned

    virtual void BeginPlay() override;

public:

    UFUNCTION(BlueprintPure)

    bool IsDead() const;

    UPROPERTY(EditAnywhere)

    bool Shooting() override;

    UFUNCTION(BlueprintPure)

    float GetHealthPercent() const;

    // Called every frame

    virtual void Tick(float DeltaTime) override;

   

    // Called to bind functionality to input

    virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

    virtual float TakeDamage(float DamageAmount, struct FDamageEvent const &DamageEvent, class AController *EventInstigator, AActor *DamageCauser) override;

    void Shoot();

   

private:

    void MoveForward(float AxisValue);

    void MoveRight(float AxisValue);

    void LookRightRate(float AxisValue);

   

    UPROPERTY(EditAnywhere)

    float RotationRate = 10;

    UPROPERTY(EditDefaultsOnly)

    float MaxHealth = 100;

    UPROPERTY(VisibleAnywhere)

    float Health;

    UPROPERTY(EditDefaultsOnly)

    TSubclassOf<AGun> GunClass;

    UPROPERTY()

    AGun* Gun;

};

What’s line 31 and did you save first before compiling?

image
its this line right here

bool Shooting() Override;

You have a UPROPERTY over the name of a function. That’s not right. it should be above a variable. I suspect it is supposed to be the UFUNCTION(BlueprintPure) instead

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms