Problems with Play Mode: Game suddenly playing faster and eating inputs

Hello.

I’m currently using the 2022.3.49f1 version. I’ve been building the basics of my 2D game for a couple of weeks. It’s pixel art and it’s using Pixel Perfect component and Cinemachine. I have movement, attacks, tiles, enemies, etc, but I still had to add animations to my game.

While setting my first animator and making a couple of clips I noticed an issue. When I tried to test the animations, the game was suddenly having a strange behavior in Play Mode. I first noticed it was eating my jump inputs. The jumping didn’t have any issue before and I haven’t changed anything related to jumping when setting up the animation. This animation isn’t even related to the player, it’s on an enemy.

After more testing I noticed that the game was also playing faster. Or at least, the coroutines that control the fire rate of the weapons were firing faster, while the game was also eating like 30% of my jump inputs.

Then I noticed the issue went away when I turned off and then on the script on that enemy from the inspector. I also noticed that turning off and on other scripts may stop the issue too, like for example the PlayerController or another script on another enemy, but only if I do it on a prefab, not on an instance that I have inside the scene. The scripts don’t necessarily have to be related with animation or anything in particular, it’s just the act of unchecking and then checking the script again in the inspector.

Finally I noticed that the issue can be triggered again by just opening an Animator Controller on the Animator Tab. And I even find that I can make it happen when I activate or deactivate the Upscale Render Texture on the Pixel Perfect component of my Main Camera. This makes me think that this is an issue more common than I initially thought and probably was happening before but I didn’t notice it.

When it’s triggered, it’s kind of annoying to make it stop. And I need it to stop to properly do quick tests on features.

Is this a known issue? Is there a known way to avoid it?

Hello, again. I solved the problem.

In case somebody finds this and has a similar issue: It happened to be that I just simply turned off the VSync from the Game Tab by accident. I didn’t realize when that happened, that’s why I was so confused. So if you experience something like this, check if VSync is on first.

I hope at least this saves someone else’s time in the future because it was a very annoying issue and I spent several hours yesterday very confused about what was happening. The fact that the issue would solve itself when deactivating certain components didn’t help me either.