Playmaker Forum
Bug Reporting => PlayMaker Bug Reporting => Topic started by: Fat Pug Studio on March 16, 2019, 06:46:19 PM
-
Hi guys, here's what's going on. I use Get Key Code to String to get keyboard input and store it into string. Works perfect when i store it into local variable, but whenever i try to set it into global variable it does not work.
- I tried saving it to local variable, then to global from that local variable, nothing
- I tried buidling the string from local variable into another local variable and then try setting the global variable, nothing
- Splitting everything into multiple states, nothing
No errors are being reported, it just doesn't work.
Unity 2018.3.7f, Playmaker 1.9.1b4
-
Oh, here's the debug.
(https://i.postimg.cc/rsrFpR5V/screenshot-243.png)
(https://i.postimg.cc/t7GRnRzh/screenshot-244.png)
FireBulletButton is a GAMEOBJECT, not STRING variable. This is how it look before i enter play mode
(https://i.postimg.cc/QCynxScP/screenshot-245.png)
I'm confused.
-
Here's the problem, definitely a bug. I have local and global variables of the same name, FureBulletButton. Even tho i chose GLOBAL in the set string action, it was setting the Local always. How do i submit this bug?
-
Here's the problem, definitely a bug. I have local and global variables of the same name, FureBulletButton. Even tho i chose GLOBAL in the set string action, it was setting the Local always. How do i submit this bug?
Actually as you mention it, I had the same with int as well.
-
HI.
So it only happends when you have global and local with the same variable name, right?
-
This one is tricky. Actions store variable names. When the FSM loads it looks first for a local variable with that name. If it doesn’t find a local variable it looks for a global variable. This is similar to c# behavior where local variables take precedence over variables with broader scope. However, the UI should tell you this in some way so you know what’s going on. E.g., an info box: local variable “x” overrides global variable “x”
-
Thanks, good to know, since then I avoid having same name local and global variables :)
-
That really sucks, but it's good to know.
-
I'll look into fixing this in the next update...