Cant get SCREEN_TOUCH_START to work

Howdy,

I’m trying to get the SCREEN_TOUCH_START event to work. I can’t seem to get it to work on a global or local level. It’s being registered in the add function of a component, I have logged that it’s being registered, and nowhere is it being unregistered.

Other events seem to work, but not this particular event.

Any help would be much appreciated!

 console.log('register screen touch')
    world.events.addListener(world.events.globalId, ecs.input.SCREEN_TOUCH_START, () => { 
      console.log("Hello") } )

    world.events.addListener(deadScreenQuitButton, ecs.input.SCREEN_TOUCH_START, () => {
      console.log('QUIT GAME')
    })

    world.events.addListener(deadScreenContinueButton, ecs.input.SCREEN_TOUCH_START, () => {
      continueGame()
    })

    world.events.addListener(gameOverScreenQuitButton, ecs.input.SCREEN_TOUCH_START, () => {
      console.log('QUIT GAME')
    })

If you’re intending to use this on 2D UI elements you should use:

ecs.input.UI_CLICK

The docs should be updated soon with this event.

Works like a charm. Thank you!

Just FYI, I was actually using 3D planes for UI like some other people have been doing in the meantime and I wasn’t receiving events for those. Nor was I when using the global eid.

Have you taken a look at the button sample project?

I haven’t no. But noted for next time!