# Variable declared with default value in VSCode and Editor puts default value as Zero.

**URL:** <https://forums.unrealengine.com/t/variable-declared-with-default-value-in-vscode-and-editor-puts-default-value-as-zero/939672>\
**Category:** Programming & Scripting\
**Tags:** vscode, unreal-engine, editor, CPP, question\
**Created:** [April 14, 2023, 3:06am UTC](https://forums.unrealengine.com/t/variable-declared-with-default-value-in-vscode-and-editor-puts-default-value-as-zero/939672 "2023-04-14T03:06:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLopLop](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/theloplop/32/678763_2.png) [@TheLopLop](https://forums.unrealengine.com/u/TheLopLop)\
**Post date:** [April 14, 2023, 3:06am UTC](https://forums.unrealengine.com/t/variable-declared-with-default-value-in-vscode-and-editor-puts-default-value-as-zero/939672/1 "2023-04-14T03:06:04Z")

</div>

Hi! I’ve been having this issue. When I declare a variable in VSCode with a default value the editor puts the value as zero.  
Why this keeps happening, I’m doing something wrong?  
(I’m using UE4.27.2)

 ![Cppture1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/2/a7244bdea9f5c068c6238c0614c1264bb5e8f1b5.jpeg)  
 ![Cppture2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/b/79b1db0307585ff2a3719bd93826c76d537c834d.jpeg)

---

<div class="post-metadata">

**Author:** ![Extrone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/extrone/32/906554_2.png) [@Extrone](https://forums.unrealengine.com/u/Extrone)\
**Post date:** [April 14, 2023, 3:34am UTC](https://forums.unrealengine.com/t/variable-declared-with-default-value-in-vscode-and-editor-puts-default-value-as-zero/939672/2 "2023-04-14T03:34:54Z")

</div>

Have you tried setting the default value this way?

```auto
UPROPERTY(EditAnywhere)
int MyInt = 123;

UPROPERTY(EditAnywhere)
bool MyBool = true;

```
