Closed timmybo5 closed 8 months ago
I can't replicate this, if I put logic in a block like this:
protected override void OnUpdate() {
if ( Input.Down( "Duck" ) )
{
Log.Info( "IsCrouching: " + Input.Down( "Duck" ) );
AnimationHelper.DuckLevel = 1.00f;
var crouchcc = GameObject.Components.Get<CharacterController>();
crouchcc.Height = 45;
CameraHeightPos = 35.0f;
}
it works totally fine for me, including logging every frame I hold duck.
Maybe something is wonky in your code...?
protected override void OnUpdate()
{
Log.Info( "IsCrouching -> " + Input.Down( "Duck" ) );
}
Just this works totally fine for me, too.
This doesn't sound right. Is there anything else you can add? Do you have a controller plugged in?
I keep forgetting my controller is plugged in all the time, unplugging it fixed the issue! Thanks :D
Still a bug though
I think most games have a sort of switching system where the game switches between controller mode and mouse/keyboard mode depending upon whichever input was detected last so that inputs don't get contaminated between the two on accident like this. Also so that input UI elements can switch over depending on which 'mode' you're in.
Something like that would be good. I guess there's some wacky situation where you might want to play a game that uses both controller AND keyboard or something like that so it should be overridable maybe, but that sounds like a pretty rare case.
Huh, this is a fun one. Looks like it'd be related to my changes the other day.
EDIT: Oh whoops looks like it was already mentioned
This should be working as intended now
Describe the bug
After 2 frames of holding down the button it returns false.