I was going through the Unity Getting Started document included with Unity 5.0 and coding/compiling the examples as I went along.
When I get to the MoveCube example, though, I get this error:
Do you want to continue?
"chase.lua:8 `=' expected near `<eof>'
...and then this error:
Error on Function Call
attempt to call a nil value
I copied and pasted the code directly from the Getting Started document, but it still returns the same error. This is not a good sign if even the simplest examples won't compile and run
Here's my LUA script:
-- Deal with AI:
function moveCube( objnum )
-- Get cam position
cx,cy,cz = CamInfo()
-- Point object at it and move
PointObject(objnum,cx,cy,cz)
MoveObject(objnum,0.01)
End
Here's my DBPro Code:
autocam off
sync on
sync rate 0
rem Create matrix for perspective
make matrix 1,1000,1000,20,20
position matrix 1,-500,0,-500
rem Create the cube
make object cube 1,10
position object 1,0,5,0
rem Position camera
position camera 0,10,-20
r=load lua("chase.lua")
rem The main loop
do
lua set function "moveCube",1,0
lua push int 1
lua call
sync
loop