Sign Up, Lost Password
Variable from another world?
I know how to access a variable from another actor but is there any way to access a variable of another world?
Yes; worlds and actors are both objects and you can access them in the same way. Once you have a reference to the other world in a variable called 'otherWorld' you just use: otherWorld.variableName ... to access the variable.
So for example if your variable was "pizzaLeft", you would declair it as 'public static int pizzaLeft;" this would enable you to access it from another level.
You need to login to post a reply.