Lua - How to use functions from another script

Posted by Person on Stack Overflow See other posts from Stack Overflow or by Person
Published on 2010-03-19T01:34:20Z Indexed on 2010/03/19 1:41 UTC
Read the original article Hit count: 196

Filed under:

I'm wondering how to use functions from another script in Lua. For example, say GameObjectUtilities holds functions that many GameObject scripts will use. The Slime (a GameObject) script wants to use a function in GameObjectUtilities.

I'm having trouble getting this to work. I've looked here, but I still don't really fully understand. Do I need to create a module or a table to hold the functions in GameObjectUtilities for the functions in it to be used in other scripts? If so, what is the best way to go about this?

© Stack Overflow or respective owner

Related posts about lua