I can't make smooth mouse movement with nodes (SOLVED)

gif%20prueba

function on_input(self, action_id, action)
if action.repeated and self.ficha_seleccionada ~= nil and action_id == hash("touch") then
	gui.set_position(self.ficha_seleccionada,vmath.vector3(action.x, action.y, 0))

Why is the sprite jerking?

60 fps

You need to change your repeat delay: https://defold.com/manuals/project-settings/#repeat-delay

OR you could track action.pressed and action.released and as long as the button is pressed you move the node:

function on_input(self, action_id, action)
	if action.pressed then
		self.pressed = true
	elseif action.released then
		self.pressed = false
	end

	if self.pressed and self.ficha_seleccionada then
		gui.set_position(self.ficha_seleccionada, vmath.vector3(action.x, action.y, 0))
	end
end
1 Like

Oh thanks, I change repeat interval to 0.04 and now goes great, thank you