I'm trying to save in a variable "world" the world my actor is in so I can use it later in commands such as This is my code:It is obviously wrong, but I personally don't know how to make it work. Could you help?
((world)getWorld()).a++;
public void worldSelector()
{
if(getWorld() instanceof level1)world = level1;
if(getWorld() instanceof level2)world = level2;
if(getWorld() instanceof level3)world = level3;
if(getWorld() instanceof level4)world = level4;
if(getWorld() instanceof level5)world = level5;
}
