Hi,
On the code base I found a way to create an animation by filling a table with the needed position.
When I add this code, it kind of works.
There is a nil error in there, which I don’t understand. At the moment the app says that there is a nill error it stutters the animation and continues as planned.
This is the code:
local rotater={}
rotater[01]={}
rotater[02]={}
rotater[03]={}
rotater[04]={}
rotater[05]={}
rotater[06]={}
rotater[07]={}
rotater[08]={}
rotater[09]={}
rotater[10]={}
rotater[11]={}
rotater[12]={}
rotater[13]={}
rotater[14]={}
rotater[15]={}
rotater[16]={}
rotater[17]={}
rotater[18]={}
rotater[19]={}
rotater[20]={}
rotater[21]={}
rotater[22]={}
rotater[23]={}
rotater[24]={}
rotater[25]={}
rotater[01].rotate=1
rotater[02].rotate=3
rotater[03].rotate=5
rotater[04].rotate=7
rotater[06].rotate=9
rotater[07].rotate=11
rotater[08].rotate=13
rotater[09].rotate=15
rotater[10].rotate=17
rotater[11].rotate=19
rotater[12].rotate=21
rotater[13].rotate=21
rotater[14].rotate=19
rotater[15].rotate=17
rotater[16].rotate=15
rotater[17].rotate=13
rotater[18].rotate=11
rotater[19].rotate=9
rotater[20].rotate=7
rotater[21].rotate=5
rotater[22].rotate=3
rotater[23].rotate=2
rotater[24].rotate=1
rotater[25].rotate=0
local animate
local posCount = 0
local function rotateObject()
print(posCount)
if posCount \<= 25 then
lammetjeHoofdGroup.rotation = rotater[posCount].rotate
posCount = posCount + 1
else
posCount=1
timer.cancel(animate)
end
end
local function rotateAnim()
posCount = 1
animate = timer.performWithDelay( 1, rotateObject, #rotater )
end
rotateAnim()
This is the error:
WARNING: Attempting to set property(rotation) with nil
the thing is it doesn’t always trigger at the same time. sometimes after frame 8 sometimes frame 7 etc.
Anyone have any ideas on what is causing this?
Thanks for the help. [import]uid: 100901 topic_id: 27314 reply_id: 327314[/import]