I have imported math in my cap
so math.atan2 works if it's in my cap's python scripts
at runtime if I use the Run Python Script action, I can use a script directly from math such as
Run Python Script: "x=math.atan2(1,2)";
but a function defined in the cap which can be called successfully within the cap itself:
#x=atantwo(1,1); would work fine here[/code:ggiv2n5i]
but if I use the Run Python Script action at runtime and try:
Run Python Script: "x=atantwo(1,2);"
I get an error:
NameError: global name 'atan2' is not defined
is this a bug, or a limitation, or is there a special way to make it work?
Develop games in your browser. Powerful, performant & highly capable.
It's working fine for me. Could you post a cap that shows the problem.
oh sorry, forgot i posted this, ill try to remember to post a cap when i get home