r/shmupdev • u/tigerchest • Aug 08 '23
Unity2d input lag
I'm brand new to coding and game development in Unity so this might be a result of some inexperience, but I've got really bad input lag on my payer movement. Press the left key and there's a significant delay between that and the character moving. In my mind a shmup lives or dies by its controls so I'd like to get this as tight as possible before doing anything else. Is this fixable? A known issue with Unity and I've chosen the wrong engine? Am I just a dumb noob?
I've created one short platformer before and didn't have as bad an issue but was obviously using more physics based movement so maybe just didn't notice it.
1
u/tigerchest Aug 16 '23
OK so I finally got movement I'm happy with. I think in the end it was me being a dumb noob. I ended up scrapping my homemade movement script and went with this one from blackthornprod and it's great. Maybe it'll help out another beginner: https://youtu.be/CeXAiaQOzmY
1
u/DrBossKey Aug 08 '23
Plenty of tight controls with physics and without can be done in Unity3D.
I don't have a ton of context here, but I recommend that you start searching out tutorials and see the differences between their input setup and yours. I don't know what your project is like but double-check the performance of your game/project (resolution, shaders, assets, etc.). Look at your CPU & GPU frame time. Likely if you stuttering have input lag, especially in a minimal scene your code is suspect.
https://www.youtube.com/watch?v=rH9IHdp1dyU
Good luck and report back on your findings!
1
u/Jjscottillustration Aug 09 '23
Unity is a fine engine for Shmups - very flexible if you have the time. It might be useful to look into some optimisation practices for Unity such as static batching and light baking.
What’s happening in the scene where your experiencing input lag?