Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

How did you manage to get the mouse wheel working in a webgl build?

Thanks for playing! I did nothing special, it just works. Here's the code I used (attached to the camera object)

public float zoomSpeed = 300f;

public float minY = 5f, maxY = 40f;

void Update ()

{

  float scroll = Input.GetAxis("Mouse ScrollWheel");

  pos.y -= scroll * zoomSpeed * Time.unscaledDeltaTime;

  

  pos.y = Mathf.Clamp(pos.y, minY, maxY);

  

  transform.position = pos;

}

Ah thanks. Was trying to read the scroll wheel input value in the new input system and while that worked fine on the Windows build it didn't seem to work on WebGL. Good to know the old input system method works no problem.