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; }
};