# variable out of scope

**URL:** <https://forums.unrealengine.com/t/variable-out-of-scope/475013>\
**Category:** Editor Scripting\
**Tags:** fov, Variable, scope, unreal-engine, question\
**Created:** [November 26, 2020, 7:30am UTC](https://forums.unrealengine.com/t/variable-out-of-scope/475013 "2020-11-26T07:30:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_f30d5242](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f30d5242](https://forums.unrealengine.com/u/anonymous_user_f30d5242)\
**Post date:** [November 26, 2020, 7:30am UTC](https://forums.unrealengine.com/t/variable-out-of-scope/475013/1 "2020-11-26T07:30:54Z")

</div>

Hi,  
I think this question has come up a lot, and I haven’t been able to fix it.  
I want to set my players default FOV on begin play from the level BP. I tried doing it in the first person character BP aswell, because I thought that might be in the right scope.  
I don’t think I understand it properly, but I tried making a function and printing the variable, like suggested here:  
[link text][1]

Here are some pictures

 ![323112-level-bp-not-in-scope.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/b/36bfb9a96e6d091291cc97d53b99df25b42b5424.png)

 ![323113-level-bp-not-in-scope-function.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/2/1e2d5ed04d4feb1b26f784d6c1fa1522530e90dc.png)

I tried casting to the player camera manager, that didn’t work. And I tried it without the function, in case that was the wrong scope. I cranked the FOV right up to 300 incase I was missing it.  
The print string prints the FOV fine.  
Any ideas anyone?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f30d5242](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f30d5242](https://forums.unrealengine.com/u/anonymous_user_f30d5242)\
**Post date:** [December 10, 2020, 8:55pm UTC](https://forums.unrealengine.com/t/variable-out-of-scope/475013/2 "2020-12-10T20:55:58Z")

</div>

Actually it seems in this case “variable not in scope” isn’t the reason for it working.  
My get player camera manager is returning nothing.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f30d5242](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f30d5242](https://forums.unrealengine.com/u/anonymous_user_f30d5242)\
**Post date:** [December 10, 2020, 8:56pm UTC](https://forums.unrealengine.com/t/variable-out-of-scope/475013/3 "2020-12-10T20:56:01Z")

</div>

Actually it is returning the right index - I think, there’s only one player so it should be playercameramanager\_0 - right?  
So it works on a screen capture 2d camera but not for my player, despite both “set default fov” nodes showing “variable not in scope” for both the target and the float pins.
