Search Unity

Question Where do we set up layers for what touch inputs interact with? (Trying to solve performance issue)

Discussion in 'Web' started by IllTemperedTunas, Oct 20, 2022.

  1. IllTemperedTunas

    IllTemperedTunas

    Joined:
    Aug 31, 2012
    Posts:
    782
    I recently did a test where if i touch the screen with many fingers very rapidly, performance greatly diminishes, but only if those touches intersect with objects in the scene that have collision. If I have a plane with a mesh collider on it, the touches seem to intersect with it and performance goes to hell. If I remove that collision and the raycasts intersect with nothing, there is no performance hit. But I need objects in my game for it to be a game so that's not an option.

    I can't figure out how to set up the layers for what generic touch inputs intersects with in Unity. Thought there might be a setting similar to "culling mask" on the camera, but it can't be found anywhere... I played with camera.eventmask a bit to no effect.

    Does anyone know where we can adjust the default touch layers for webGL?

    (This issue only occurs with touch devices in the WebGL, every other build is fine)
     
    Last edited: Oct 21, 2022