I'm trying out a script that makes entities appear and disappear depending on the positions of switches. Everything works exactly as planned, except that I get this error log message: "Warning: variable 'ent_handle_2_down' is inaccessible in the current block. Consider changing the script."
I've tried the scene back and forth, and it no doubt works perfectly, despite the message. I can not see how I could mess around with the "inaccessible" variable without causing major dysfunction.
The code looks like this (it's probably idiotic):
global handles_down;
on "LeftClick"
{
if(handles_down==1)
{
global handle_2_down = 1;
var ent_handle_2_down = Scene.GetNode("handle_2_down");
if(handle_2_down==1) ent_handle_2_down.Active = true;
handles_down = 2;
}
else
{
handle_2_down = 1;
ent_handle_2_down = Scene.GetNode("handle_2_down");
if(handle_2_down==1) ent_handle_2_down.Active = true;
handles_down = 0;
}}
The warning refers to the 3rd line from the bottom.
Thanks,
Mikael