# UPROPERTY(EditAnywhere) variable when changed in the editor dont reflect in the game

**URL:** <https://forums.unrealengine.com/t/uproperty-editanywhere-variable-when-changed-in-the-editor-dont-reflect-in-the-game/397424>\
**Category:** Blueprint\
**Tags:** axis-mappings, UProperty, unreal-engine, pawn, question, Blueprint, CPP\
**Created:** [July 14, 2017, 4:54pm UTC](https://forums.unrealengine.com/t/uproperty-editanywhere-variable-when-changed-in-the-editor-dont-reflect-in-the-game/397424 "2017-07-14T16:54:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dogu189](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dogu189](https://forums.unrealengine.com/u/dogu189)\
**Post date:** [July 14, 2017, 4:54pm UTC](https://forums.unrealengine.com/t/uproperty-editanywhere-variable-when-changed-in-the-editor-dont-reflect-in-the-game/397424/1 "2017-07-14T16:54:56Z")

</div>

So I have created Zoom ability to my pawn and I would like to be able to change the Maximum and Minumum zoom in the editor  
So I created this in the .h file:  
Code:

```
UPROPERTY(EditAnywhere, Category = Ball)
float MinZoom;

UPROPERTY(EditAnywhere, Category = Ball)
float MaxZoom;

```

declared them in the constructor  
and made created a method for zooming ability in .cpp:  
Code:

```
void AMyPawn::Zoom(float Axis)
{
	float ArmLengthfactor = -Axis * 20.f;
	CameraSpring->TargetArmLength = FMath::Clamp(CameraSpring->TargetArmLength + ArmLengthfactor, MinZoom, MaxZoom);
}

```

which worked!  
but I decided to tweak the values in the editor to get a more feasible value, but for some reason when I changed the value in editor nothing changed in zooming.  
So I went in the code changed it manually and then it worked.

Why is it that when I change the value in the editor doesnt work but when I change the value in code it works?

Remember that Im spawning the Blueprint drived from the c++ class. I have tried it both ways.
