Do Defold support touch in html5 build? (SOLVED)


Are you testing on a device which supports multitouch / in chrome with multitouch simulator active?

Does the above link work on your device?

It will not work in vanilla chrome or defold as there is no fallback for normal touch/click in the example atm.



I tested In safari, ios 11, iphone 6s.
It count all touches, but position of orbs do not work.



The linked version doesn’t work or the copy downloaded from github doesn’t work?

This is older version of github project with some different changes, I believe it’s the version from that link. has updated version.

I only have older iOS devices so unfortunately I probably can’t help with this. Someone else will need to. It’s also possible the reason it’s not working well on iOS is because it interferes with what Defold is using to get touch. I’m not sure. It would be better at this point to wait until Defold team can add multitouch support for html5 in and test as they probably have access to more devices.

1 Like


It seems to me, that parsing json in every update at 60 fps, then using it to control the virtual joystick in an Instant game is very quick & dirty hack.
@britzl, @Oleg_The_Evangelist guys from Defold, we need your help, or do you think this is good solution for multi-touch html5 instant games?

function update(self, dt)
	local touch_data = json.decode("get_touch_data()"))


function get_touch_data() {
	return JSON.stringify(touch_data);


Do you have an alternative control scheme when playing on desktop?



Yes, we have keyboard for movement and mouse for firing on desktop. On mobile we need to use virtual joystick (first touch) and second touch for firing.



This is obviously not optimal, but it’s on the other hand not the end of the world either. Since it’s done only once per frame I guess it will not have a really severe impact on performance. But it is a call from engine to JS which I’m guessing isn’t going to be super fast. And json.decode is pretty fast, so all in all you should be ok with this solution.

1 Like


Is there an ETA on when we might have multi-touch support for HTML5 builds?

1 Like


We’ve had it in the two most recent sprints but decided to push it ahead of us in favour of modularising the engine further. During this sprint we’ll move iap.* and iac.* to native extensions which should conclude the work for now. My guess would be that we tackle multi-touch in 1.2.164, but I can’t make a promise (we really want to do it though!).



I really want you to do it too! It would be super-helpful to me, at least.



Solved in 1.2.164