Input Delay on Crouch (Unity 2D)

in #blog3 years ago (edited)

Sometimes it's the simpler solutions...

Pixel Art Sprite of Robot

Alright, so, Unity folk, check this out. I was going to continue working on animations and transitions etc, but instead I decided to go after a problem that had been plaguing me for a long time that I had never resolved.

“Delayed Crouch Input"

I couldn't figure it out, I looked everywhere, I didn't know if it was somehow an issue with Unity itself, or the corgi plugin. I was pouring through the crouch script to see if I could spot something in there that was causing the delay, I tried different scenes that had been created by the corgi developers themselves, but no solution was found...

SO, I took different approach, I plugged in the USB xbox controller, and wouldn't you know it... crouching with the joystick showed ZERO delay! Even when I looked at the raycasting in the scene window, I could see that the arrow was responding EXACTLY as I pushed down.

Unity Screenshot showing downward raycasting for sprite

So what could it be? Could my keyboard itself be delayed for some reason? I looked into remapping the controls, which turned out to have nothing to do with corgi itself, but Unity's input settings under "Edit > Project Settings > Input". I tried changing crouch to other keys, but the issue remained... until I noticed one field in the options, "Sensitivity", set to 4... I changed it to 1000 and surely enough, the delay was FINALLY fixed!!!!

Overjoyed that I finally found the problem and fixed it, however kind of enraged at whoever set 4 as the default sensitivity lol.

Settings showing input sensitivity cranked to 1000

So if you're ever having what appears to be input delays, BE SURE to check the sensitivity on the input settings.

Peace out ladies and gentlemen, ‘twas a fruitful game development session, and am PLEASED.

Sort:  

Hi @nathansifugaming...
Introducing me afrizalbinalka witness promoter team pennsif.witness and right now, we are travelling around to get support from active users of steemit.inc platform. In this case, we would like to invite you to give us your support (vote) which means a lot to us. If you do, it would be an honour for us.

Pennsif Witness Promoter Team

png_20230225_075727_0000.png

You can choose two ways to select a witness below⤵️

steemit wallet.com

steemit login.com

History pennsif

After 5 years on the platform I have recently launched a Steem witness - @pennsif.witness.

You may know me for Steem News, which is now nearing its 500th edition.

As a witness I am running a Full API Node and a Seed Node. Together with the @steemwow team I have also launched Press4Steem, a plugin to connect WordPress sites with Steem.

It would be great if you are able to support my work by giving one of your witness votes to @pennsif.witness.

If you have any questions about Steem, or if I can help you with anything please contact me on Discord at Pennsif#9921.

Thank you

Pennsif