Web Game - lag when mouse moves

Hello.

I’m making a very simple arcade web game with only a few objects in scene. When I test it everything works great with no lag, but when the user moves the mouse then the game gets a lot of lag so my objects begin to seep between platforms.

  • The mouse isn’t a game control, the only Input that I have configured is the spacebar.
  • I have the same problem when I test it in kongregate as when I test it directly on browser(Chrome and firefox)
  • I don’t have this problem when I run the game in unity

What can I do?

Lock your mouse, so it won’t recognize any input from it.

void Start()
{
    Screen.lockCursor = true;
}

If you need it before you actually start the game, just have a method trigger that code when you open the new scene.

I thought that I was the only one with this problem but I already run some other games in Kongregate that were made with unity and it happens the same problem I: and because I don´t see any questions about this problem; I think that the problem is my pc :C