Although there are plenty of better tutorials out there online, this is a sort of “cheat sheet” for coding that may still help even if you have had experience with another coding language before
- Artspark’s inner engine functionality is wrapped under a single object simply called “obj”
- Comments are lines of text that you can write in a script for others to better understand the code
–This is a comment - If / Then / Else
if value == value2 then
–Do something when it matches
else
–Do something else
end - Joining strings together
- “this” .. ‘and’ .. “that”
- Passing multiple variables or lines of code as strings
- Escape the LUA script similar to Javascript
- Otherwise, you can store the string using a block of text in LUA formatting:
scriptAsString = [[
function testFunction()
obj.set3DText(“Test”)
end
]]
- Optional values can be ignored entirely, either skipped with an empty value or left off the end of a command