Hello everyone, I’m new to Defold
I’m making my first game and would like to do a sort of intro
After 3sec, the title appears, and after 1 seconds, it move sup
the problem is, after the 1 second waiting, I have this probleme
ERROR:SCRIPT: main/Title script.script:15: attempt to perform arithmetic on field 'pos' (a nil value)
stack traceback:
main/Title script.script:15: in function <main/Title script.script:13>
here is my script:
function init(self)
sprite.set_constant("/FishyJourney", "tint", vmath.vector4(1, 1, 1, 0))
local pos = vmath.vector3()
end
function final(self)
end
function update(self, dt)
timer.delay(3, false, function()
sprite.set_constant("/FishyJourney", "tint", vmath.vector4(1, 1, 1, 1))
timer.delay(1, false, function()
for i=1, 20 do
self.pos = self.pos + 10
end
end)
end)
end