Jump to content

scene.onPointerObservable Does not handle Touch Events?


Recommended Posts


when trying to debug this with touch interaction, it seems like I have not set something up correctly.

I am testing on an iPhone 6s and nothing happens.  I can manually bind for touch events on the dom context, but was wondering what our convention is.

Also noticed touching the playground examples link does nothing as well.

Link to comment
Share on other sites

Well what is the expected outcome? It seems to not work even with mouse (at least visually)

From a quick look, it seems that you use OnPointerObservable which is the expected way of working with mouse/touch

Link to comment
Share on other sites

Click and drag on the screen starting from the bottom and release at some point up from where you started.
and you will 'throw; something and also see the input path for a little bit on the screen.

Do it at different speeds.

I cant get it to respond at all to touch.

Link to comment
Share on other sites

Yup its confirmed the iPhone ignores the touches 

should alert "TOUCHED" when I touch the canvas on my phone.

*UPDATE* hmm it does in fullscreen mode.

All the events are happening, but it seems like something is not happening.  I bet its my event.clientX stuff.


((new BABYLON.Vector3(e.event.offsetX/canvas.width, (canvas.height - e.event.offsetY)/canvas.height, 0)).scale(2.0)).subtract(new BABYLON.Vector3(1.0, 0, 0))

this seems to push NAN's on the iPhone... odd.

got it... I forgot offsetY and X are not on iPhones o_O...

woot this actually works really well with touch.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...