missing type specifier - int assumed error

#pragma once

#include "CoreMinimal.h"
#include "CapsuleValues.generated.h"


USTRUCT(BlueprintType)
struct FCapsuleValues
{
	GENERATED_BODY()
public:
	UPROPERTY(EditAnywhere,BlueprintReadWrite)
	float Height;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float Radius;

	FCapsuleValues() {};

	FCapsuleValues(float H, float R) {
		Height = H;
		Radius = R;
	}

};

and implementation in character example

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

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "CapsuleValues.h"
#include "MyCharacter.generated.h"



UCLASS()
class GAME_API AMyCharacter : public ACharacter
{
	GENERATED_BODY()

public:
	// Sets default values for this character's properties
	AMyCharacter();

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;

protected:

	FCapsuleValues CapsuleValuesCrouch;
	FCapsuleValues CapsuleValuesNonCrouch;

};

You need a parameter-less version of the constructor as you are not passing in the height and radius in the uninitialized parameters (so default parameter-less is normally called)

2 Likes