The identifier '/instance0' is already in use Error when trying to go.animate?

Why do I get The identifier '/instance0' is already in use. error only when I change this line of my script;

go.set_position(vmath.vector3(math.random(self.pos.x-100, self.pos.x+100), math.random(self.pos.y-100, self.pos.y+100), 0))

to this;

go.animate(".", po, go.PLAYBACK_ONCE_FORWARD, vmath.vector3(math.random(self.pos.x-100, self.pos.x+100), math.random(self.pos.y-100, self.pos.y+100), 0), go.EASING_OUTQUART, self.duration)
Full Script (Look at Line 11 & 12)
 function init(self)
	coinModule = require "main.coinModule"
	self.trigger = hash("trigger_response")
	self.duration = 0.3
	self.po = hash("position")

	-- Move randomly
	self.pos = go.get_position()
	self.pos = vmath.vector3(math.random(self.pos.x-100, self.pos.x+100), math.random(self.pos.y-100, self.pos.y+100), 0)

	--[[ This will error --]] go.animate(".", po, go.PLAYBACK_ONCE_FORWARD, self.pos, go.EASING_OUTQUART, self.duration)
	--[[ This won't error --]] go.set_position(self.pos)
end


function on_message(self, message_id, message, sender)
	if message_id == self.trigger then
		if message.enter then

			self.spr = msg.url(".")
			self.spr.fragment = "sprite"
			
			-- Animation
			go.animate(".", self.po, go.PLAYBACK_ONCE_FORWARD, go.get("/plr", hash("position")), go.EASING_OUTQUART, self.duration)
			go.animate(self.spr, "tint.w", go.PLAYBACK_ONCE_FORWARD, 0, go.EASING_LINEAR, self.duration)

			coinModule.changePoints(10)

			-- Delete the collectable
			timer.delay(self.duration, false, function()
				print("Deleted")
				go.delete(".", true)
			end)
		end
	end
end

You are using po and not self.po.

2 Likes

Yes, this is a problem.

This is actually not a problem. You can use go.animate() from init().

Edited to for correction.

Oh… im dumb. Thanks