Why are some of my variables not in scope when debugging in blueprints?

Hey guys,

Ran into a weird scope issue today. The reason I think it’s odd is that I’m pulling three variables from an object - two INTs and a NAME variable - and the NAME variable is being updated fine. I’m getting out of scope errors on the two INT variables though (Current Stack Size and Max Stack Size).

Any thoughts on why only some variables would be in scope, when they’re all being called the same way, from the same place?

Getting an array of objects of type BP_BaseItem…

The left side bar of BP_BaseItem…

5550-notinscopeissue2.jpg

What makes sense to me right now is that a name is a value, same as an int. I had to create the name value and set it in the BaseItem blueprint, which is the exact same thing I did with the ints.

In this context, I’m currently understanding the term Object to mean a container (of sorts) that holds data, like names and values. Because of this thought process, your suggestion sounds like I’d be making an array of ints for an object that always has one int (i.e. I won’t ever have multiple Max Stack ints for the same object).

I needed an array to hold the objects, and each object holds the individual data that I need. I could be wrong, but it doesn’t make sense to me that I’d need an array to hold data that’s already being held inside the Object. I should be able to just call on it on a per-object basis, which is what I’m attempting to do with the for loop.

But please correct me if I’m wrong. I’m not a guru at blueprint (or code logic).

When I pull from the array object, it allows me to get the variable…

Hey ,

Are you getting the out of scope errors when compiling or when watching the variables’ pins during PIE/Simulate?

-Steve

When I watch them during PIE. No errors when compiling.

I actually just solved this issue about 30 minutes ago but have absolutely no idea how I solved it. Ghost bug? I dunno.

Glad it is resolved for you–if you figure out what you did to solve it, please bump this thread with your solution. We were not able to reproduce the issue internally based on the setup from your screenshots.

I’m getting this too. UE 4.2.1, OSX. I started by building Zak’s 3rd Person tutorial then started experimenting with doing the input in a PlayerController instead of on the Pawn/Character.

I copied all the logic into the BP, remade all the required variables, fixed the compiler errors etc.

Then in the animation BP changed to the Cast to Chararacter to Cast to MyController.

In the screenshot you can see the bool ‘InvertVerticalLook’ is fine but for some reason ‘IsPunching’ is ‘Out of Scope’ All other functionality is working.