x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

C++ Declaration error when building

Got this as my .h file and I'm getting the 'error : Missing ',' in Class declaration declaration specifier'

I've been through the code so many times I'm losing my mind, been through the forums and can't find this error.

Any help appreciated, thanks

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "CoreMinimal.h"
 #include "GameFramework/Character.h"
 #include "JumpCharacter.generated.h"
 
 UCLASS(config-Game)
 class TOYGAME_API AJumpCharacter : public ACharacter
 {
     GENERATED_BODY()
 
     /** Camera boom positioning the camera behind the character */
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Camera, meta = (AllowPrivateAccess = "true"))
     class USpringArmComponent* CameraBoom;
 
     /** Follow camera */
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Camera, meta = (AllowPrivateAccess = "true"))
     class UCameraComponent* FollowCamera;
 
 public:
     // Sets default values for this character's properties
     AJumpCharacter();
 
     /** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Camera)
         float BaseTurnRate;
 
     /** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Camera)
         float BaseLookUpRate;
 
     UFUNCTION()
         void OnStartJump();
 
     UFUNCTION()
         void OnStopJump();
 
 protected:
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
 
     //sets the jump counter
     int JumpCounter = 0;
 
     //adds the double jump function
     bool bDo;
 
     //sets condition for first jump
     void MyDoOnce();
 
     //resets the jump counter
     void ResetMyDoOnce();
 
 
     /** Called for forwards/backward input */
     void MoveForward(float Value);
 
     /** Called for side to side input */
     void MoveRight(float Value);
 
     /**
     * Called via input to turn at a given rate.
     * @param Rate    This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
     */
     void TurnAtRate(float Rate);
 
     /**
     * Called via input to turn look up/down at a given rate.
     * @param Rate    This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
     */
     void LookUpAtRate(float Rate);
 
     /** Handler for when a touch input begins. */
     void TouchStarted(ETouchIndex::Type FingerIndex, FVector Location);
 
     /** Handler for when a touch input stops. */
     void TouchStopped(ETouchIndex::Type FingerIndex, FVector Location);
 
 public:    
     // Called every frame
     virtual void Tick(float DeltaTime) override;
 
     // Called to bind functionality to input
     virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
 
     /** Returns CameraBoom subobject **/
     FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
     /** Returns FollowCamera subobject **/
     FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
 
     
 };
Product Version: UE 4.17
Tags:
more ▼

asked Nov 07 '17 at 04:12 PM in C++ Programming

avatar image

Tomo3003
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You should have a look in the two header files too.

include "GameFramework/Character.h"

include "JumpCharacter.generated.h"

more ▼

answered Nov 07 '17 at 05:17 PM

avatar image

BugSwat
210 9 14 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question