C++ Variables not available in Blueprint

Hello,

I am trying to follow 3rd Person Power Up Game Tutorial and I am stuck on part 7 “Applying a Dynamic Material Instance to Our Character” here. I realize that this tutorial is for an older version of the engine, but I have been able to get everything to work so far after googling for how to update the C++ classes.

However on part 7 in the video the blueprint has access to the declared variables in the c++ class but it isn’t working for me. Neither the variables are available nor is the category of Power. I can see where the Character entity is inheriting the tutorialCharacter class but I’m not sure where I’m going wrong.

Also I’m working on a mac with x-code, and I’m compiling with the scheme tutorial - Mac. But i’m not sure if this is the correct option. I’m fairly new to C++ as well so i’m not sure if I’m using the correct compile target.

Any help on this would be greatly appreciated.

Below is the contents of tutorialCharacter.h:

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/Character.h"
#include "tutorialCharacter.generated.h"

UCLASS(Blueprintable, config=Game)
class AtutorialCharacter : public ACharacter
{
	GENERATED_BODY()

	/** Camera boom positioning the camera behind the character */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
	class USpringArmComponent* CameraBoom;

	/** Follow camera */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
	class UCameraComponent* FollowCamera;
    
    
    
public:
    
    virtual void Tick(float DeltaSeconds) OVERRIDE;
    
    /** Collection Volume */
    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Power")
    USphereComponent* CollectionSphere;
    
    // Power level of the character
    UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Power")
    float PowerLevel;
    
    // Speed multiplier
    UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Power")
    float SpeedFactor;
    
    // Base speed for the character
    UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Power")
    float BaselineSpeed;
    
	AtutorialCharacter();
    
    AtutorialCharacter(const FObjectInitializer& ObjectInitializer);

	/** 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;

protected:
    
    /** Called when we press a key to collect batteries inside the sphere component */
    UFUNCTION(BlueprintCallable, Category = "Power")
    void CollectBatteries();
    
    
    /** Called by collect batteries to use blueprinted PowerUp functionality */
    UFUNCTION(BlueprintImplementableEvent, Category = "Power")
    void PowerUp(float BatteryPower);

	/** 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);

protected:
	// APawn interface
	virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
	// End of APawn interface

public:
	/** Returns CameraBoom subobject **/
	FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
	/** Returns FollowCamera subobject **/
	FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
};

I’m gonna quote the first comment in the youtube video: “To get access to the variables in the Blueprint you have to click on the eye next to the search bar in the “My Blueprint” tab and then choose “Show Inherited Variables”.”

When that video was made, all the inherited variables showed up by default. Try that, or right click on the Graph and type Get PowerLevel.

Could that be it?

I read that last night as well and was hoping that it would fix it, but they still aren’t displaying. It’s very frustrating.

This works perfectly, thank you!

try this as the header
I was able too see my variables under blueprint with this header

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "TheNameOfYourCategory")

If you are working on a mac, you have to close the editor completely after compiling to get the variables to appear. The Hot Reload works occasionally, but for the most part, consider that it doesn’t work.

The most convenient way to get around this is to open the editor from debug mode in XCode. I open my project backwards. I go to my project directory and double click the “.xcodeproj” file. This opens XCode, then I select from the pulldown, the “Editor” scheme. The name in the scheme pulldown will be "yourproject"Editor. Then you click the right-pointing arrow and it will open the Unreal Editor.

From then on, anytime you add or change a blueprintable event, a blueprint variable, or a blueprint function to your C++ code, close the editor by pressing the square block icon in XCode, and reopen by pressing the arrow again. Be certain you’ve done a Save All in the editor before you do this, or you will lose your editor work.

I’m reasonably sure that you don’t need to do this for all blueprint oriented C++ changes, but I find it’s random enough that it’s simpler just to follow this procedure. Making purely C++ changes does not require this, only those related to blueprint communication.

I believe this is a bug and it has been mentioned several times, but nothing has been done about it yet.

You are welcome, it messed me up for a month. I wish it were fixed, it would be nice to open the editor like everyone else does!