Why can't I change variables in Editor?

Hey! I started working with C++ and had a small problem with my variables. They show up in the player’s blue print, but I can’t actually modify any of the variables. Anyone know why?

    // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
    #pragma once
    
    #include "InstinctCharacter.generated.h"
    
    UCLASS(config=Game)
    class AInstinctCharacter : public ACharacter
    {
    	GENERATED_UCLASS_BODY()
    
    	/** Pawn mesh: 1st person view (arms; seen only by self) */
    	UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
    	TSubobjectPtr<class USkeletalMeshComponent> Mesh1P;
    
    	/** First person camera */
    	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
    	TSubobjectPtr<class UCameraComponent> FirstPersonCameraComponent;
    
    	/** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
    	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
    	float BaseTurnRate;
    
    	/** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
    	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
    	float BaseLookUpRate;
    
    	/** Gun muzzle's offset from the characters location */
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
    	FVector GunOffset;
    
    	/** Projectile class to spawn */
    	UPROPERTY(EditDefaultsOnly, Category=Projectile)
    	TSubclassOf<class AInstinctProjectile> ProjectileClass;
    
    	/** Sound to play each time we fire */
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
    	USoundBase* FireSound;
    
    	/** AnimMontage to play each time we fire */
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
    	UAnimMontage* FireAnimation;
    
    	//Player health
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Health)
    	INT64 plHealth;
    
    	//Max Player health
    	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Health)
    	INT64 plMaxHealth;
    
    	//Initial Health
    	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Health)
    	INT64 plInitHealth;
    	
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Weapon)
    	INT64 wpAmmo;
    
    	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Weapon)
    	INT64 wpInitAmmo;
    
    	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Weapon)
    	INT64 wpMaxAmmo;
    
    	UFUNCTION()
    	void dealDamage(INT64 Damage);
    
    	virtual void BeginPlay() OVERRIDE;
    
    protected:
    
    	/** Handler for a touch input beginning. */
    	void TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location);
    
    	/** Fires a projectile. */
    	void OnFire();
    
    	/** Handles moving forward/backward */
    	void MoveForward(float Val);
    
    	/** Handles stafing movement, left and right */
    	void MoveRight(float Val);
    
    	/**
    	 * 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);
    
    protected:
    	// APawn interface
    	virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) OVERRIDE;
    	// End of APawn interface
    };

Thank you in advance!

Edit: Posted the whole header code due to a request.

Below: This is what I get in Blueprint. I can see it, but I cannot modify it.

4992-plhealth.png

Blueprint for some reason currently does not support int16 type, use int32 insted

Well now I have

//Player health
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Health)
	int32 plHealth;

And it still just shows a grey “0” in the blueprint and no way that I can edit it.

Did you hot recompile or did you do a recompile and reload?

I have no idea :smiley: I built the solution, compiled in the editor and they appeared as they should (just without being editable)

Right, so compiling in the Editor is hot recompile. Try compiling in Visual Studio and then restarting the Editor.

Thank you for your reply, but unfortunatly, this doesn’t really change anything. I built the whole solution once and it still doesn’t let me change the values.

Is it possible to post up your entire C++ source code for that file?

Yes sure, it’s just a slightly modified version of the epic games first person character header anyway. Check the question, I updated it.

Try to specify size in bits - int32 plHealth:2;

Judging from my experiences and other tutorials, including the one from Epic Games, it seems normal that you are not able to edit the default values in the editor. I guess I will just have to use the .cpp file for that kinda stuff.

Example: Introduction to Programming | Live Training | Unreal Engine - YouTube

When he creates the blueprint, you can see that the “rotation rate” variable is also greyisch like my variables, meaning he cant edit them either.

Edit -
Nevermind, this got it to work somehow:

UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Health)

Jokes on me.