I have changed LITERALLY NOTHING. And it was working last time i was testing.
I aslo can’t read errors yet
java.lang.AssertionError: Assert failed: Cycle detected on node type editor.collection/CollectionNode and output :build-targets
(not (contains? (:in-production evaluation-context) (gt/endpoint node-id label)))
Here’s the script for reference:
local speed = 30
function init(self)
msg.post(".", "acquire_input_focus")
self.dir = vmath.vector3()
self.current_anim = nil
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)
-- player animation
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("Up")
elseif self.dir.y < 0 then
anim = hash("Down")
end
if anim ~= self.current_anim then
msg.post("#sprite", "play_animation", { id = anim })
self.current_anim = anim
end
-- play idle animation
self.dir = vmath.vector3()
end
function on_input(self, action_id, action)
if action_id == hash("down") then
self.dir.y = -1
elseif action_id == hash("up") 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