# Why I'm getting variable not in scope error on every blueprint?

**URL:** <https://forums.unrealengine.com/t/why-im-getting-variable-not-in-scope-error-on-every-blueprint/460794>\
**Category:** Blueprint\
**Tags:** error, add-variable, unreal-engine, UE4, Blueprint, question\
**Created:** [January 21, 2020, 6:11am UTC](https://forums.unrealengine.com/t/why-im-getting-variable-not-in-scope-error-on-every-blueprint/460794 "2020-01-21T06:11:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeeQuietGamingYT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BeeQuietGamingYT](https://forums.unrealengine.com/u/BeeQuietGamingYT)\
**Post date:** [January 21, 2020, 6:11am UTC](https://forums.unrealengine.com/t/why-im-getting-variable-not-in-scope-error-on-every-blueprint/460794/1 "2020-01-21T06:11:28Z")

</div>

From last few days I’m getting variable not in scope error on my variables in every blueprints which causes the funtions not work. Can anyone please solve this problem?

 ![295631-screenshot-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/6/f/86f5509736377a4ad35b3bebe6c332a4d7c236b4.png)

---

<div class="post-metadata">

**Author:** ![GarnerP57](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GarnerP57](https://forums.unrealengine.com/u/GarnerP57)\
**Post date:** [January 21, 2020, 8:35am UTC](https://forums.unrealengine.com/t/why-im-getting-variable-not-in-scope-error-on-every-blueprint/460794/2 "2020-01-21T08:35:01Z")

</div>

The variable will only be in scope if you add a breakpoint and step over it. You could add a watch to the variable but watches can be a bit dodgy.

Print string is the most reliable tool.

---

<div class="post-metadata">

**Author:** ![BeeQuietGamingYT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BeeQuietGamingYT](https://forums.unrealengine.com/u/BeeQuietGamingYT)\
**Post date:** [January 22, 2020, 5:47am UTC](https://forums.unrealengine.com/t/why-im-getting-variable-not-in-scope-error-on-every-blueprint/460794/3 "2020-01-22T05:47:52Z")

</div>

I tried using print string but it didn’t work, I think so this problem is associated with my character, is there any other way?

---

<div class="post-metadata">

**Author:** ![BlueMind\_Studio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BlueMind\_Studio](https://forums.unrealengine.com/u/BlueMind_Studio)\
**Post date:** [January 22, 2020, 11:05am UTC](https://forums.unrealengine.com/t/why-im-getting-variable-not-in-scope-error-on-every-blueprint/460794/4 "2020-01-22T11:05:33Z")

</div>

Add a printstring and breakpoint to the castFailed pin. I guess it can’t cast, so you will not get the output you expect? also add a breakpoint to your set node, there sould be the variable in scope when the debbuger halts.

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [January 22, 2020, 2:57pm UTC](https://forums.unrealengine.com/t/why-im-getting-variable-not-in-scope-error-on-every-blueprint/460794/5 "2020-01-22T14:57:52Z")

</div>

What are you inputting as the object to the cast node?

---

<div class="post-metadata">

**Author:** ![BeeQuietGamingYT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BeeQuietGamingYT](https://forums.unrealengine.com/u/BeeQuietGamingYT)\
**Post date:** [February 1, 2020, 3:43pm UTC](https://forums.unrealengine.com/t/why-im-getting-variable-not-in-scope-error-on-every-blueprint/460794/6 "2020-02-01T15:43:51Z")

</div>

get player character
