# getting variables from a cpp/h file to be read by another cpp file

**URL:** <https://forums.unrealengine.com/t/getting-variables-from-a-cpp-h-file-to-be-read-by-another-cpp-file/6714>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [June 26, 2014, 9:11pm UTC](https://forums.unrealengine.com/t/getting-variables-from-a-cpp-h-file-to-be-read-by-another-cpp-file/6714 "2014-06-26T21:11:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![anonymous\_user\_2fe3904e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2fe3904e](https://forums.unrealengine.com/u/anonymous_user_2fe3904e)\
**Post date:** [June 27, 2014, 9:51am UTC](https://forums.unrealengine.com/t/getting-variables-from-a-cpp-h-file-to-be-read-by-another-cpp-file/6714/3 "2014-06-27T09:51:02Z")

</div>

I tried that a little later after some research, I found this site

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

I followed it to the letter but its not recognizing UMyAnimInstanceClass in the character class.

PlayerCharacter.cpp

```auto

void APlayerCharacter::TurnAtRate(float Rate)
{
	// calculate delta for this frame from the rate information
	AddControllerYawInput(Rate * BaseTurnRate * GetWorld()->GetDeltaSeconds());
	UMyAnimInstance * Animation = Cast<UMyAnimInstance>(Mesh->GetAnimInstance());
	Animation->AimRight += Rate * BaseTurnRate * GetWorld()->GetDeltaSeconds();
}

```

MyAnimInstance.h

```auto

#pragma once

#include "Animation/AnimInstance.h"
#include "MyAnimInstance.generated.h"

/**
*
*/
UCLASS(transient, Blueprintable, hideCategories = AnimInstance, BlueprintType)
class UMyAnimInstance : public UAnimInstance
{
	GENERATED_UCLASS_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
		float AimUp;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
		float AimRight;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
		bool Running;
	
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
		bool Jumping;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
                float AnimationNumber 
};

```

is there something im missing?

---

_[View the full topic](https://forums.unrealengine.com/t/getting-variables-from-a-cpp-h-file-to-be-read-by-another-cpp-file/6714)._
