I’ve seen a few topics on this issue but none of them resolved my issue. Right after finishing the tutorial I get this error message:
ERROR:GAMESYS: Unable to play animation ‘left’ from texture ‘/_generated_294aab8e.texturec’ since it could not be found.
I will paste my code, but it should be exactly the same as the tutorial instructions.
local speed = 150
function init(self)
msg.post(".","acquire_input_focus")
self.dir = vmath.vector3()
self.current_anim = nil
end
function final(self)
-- Add finalization code here
-- Remove this function if not needed
end
function update(self, dt)
if vmath.length_sqr(self.dir) > 1 then
self.dir = vmath.normalize(self.dir)
end
local p = go.get_position()
go.set_position(p + self.dir * speed * dt)
local anim = hash("idle")
if self.dir.x > 0 then
anim = hash("right")
elseif self.dir.x < 0 then
anim = hash("left")
elseif self.dir.y > 0 then
anim = hash("back")
elseif self.dir.y < 0 then
anim = hash("front")
end
if anim ~= self.current_anim then
msg.post("#sprite", "play_animation", { id = anim })
self.current_anim = anim
end
self.dir = vmath.vector3()
end
function on_message(self, message_id, message, sender)
-- Add message-handling code here
-- Remove this function if not needed
end
function on_input(self, action_id, action)
if action_id == hash("front") then
self.dir.y = -1
elseif action_id == hash("back") then
self.dir.y = 1
elseif action_id == hash("left") then
self.dir.x = -1
elseif action_id == hash("right") then
self.dir.x = 1
end
end
function on_reload(self)
-- Add reload-handling code here
-- Remove this function if not needed
end
The atlas is also named correctly to “left” but I will post a screen:
Thanks!