Is there anyway to get around this? It won't let me create a global inside a function.
Globals inside Functions
Blitz3D Forums/Blitz3D Beginners Area/Globals inside Functions Correct... Create them outside a function. This is normal programming behaviour as far as I'm aware as if your function was called recursivly it would be very messy indeed.
You should just declare all your globals at the start of the program. Why would you be declaring them in a function any way?
Well i am loading my models in and globalising the name so i can use them in creation functions, and i just wanted to put them in a function in an include to keep them neat.
i will just not put them inside a function in an include then :)
i will just not put them inside a function in an include then :)
Why not just declare the model variables as globals
global MyShip
global EnemyShip
and then do what your doing ...
Function LoadStuff()
Myship = loadmesh("Blah")
end function
etc...
global MyShip
global EnemyShip
and then do what your doing ...
Function LoadStuff()
Myship = loadmesh("Blah")
end function
etc...
Thats what I always do!