Input variable for my framework glitches when the shift key is pressed

Hello DevForum,

Basically, I’m dealing with an issue of unknown origin. I have a system in place that catches important inputs, and it’ll do a ton of various stuff, heavily based off Ampro’s setup besides the server-side, and use of server invoking to avoid memory build up and lag.

Now, the issue comes when I try to make my running system work. It works until a certain point, whenever the LeftShift key is pressed. It’ll automatically make the input nil, and give it no chance of being able to change.


image

Now, for more insight, InputChecker sees if a key is being held, and if it is, just don’t really do anything until that key is released, and then remove it on my InputEnded. It stores it in a table corresponding to the input, but honestly I don’t know what the issue is.


When it breaks, the only thing I notice is that it’ll print true once more then the input becomes nil.

I feel like there is some missing context here, I also have a feeling that your InputChecker is stopping any more input when it reaches a nil value as it believes that a key is being pressed.

Well, the InputChecker is pretty simple in nature, and the keys it can run through are limited as well, as shown here (there are a LOT of keys, that shouldn’t be in here but when it’s relevant I will take care of it.)

image
image
image

I don’t see your InputChecker anywhere here?

It’s named as InputChecker in the client. But there’s a check function.

Attempt to have it print out every time it believes that a key is being pressed, instead of every key that passes through your original script. If it is printing nil then it will confirm that your InputChecker believes that a key has been pressed when it in fact has not.

Once I press shift, there’s no output, but the output that was coming previously was -


image

So, I’m assuming the origin of the problem is located directly on the client, with the Input function.

Not once was that printed for the leftshift.
image

Wait I just realized that there isn’t even a shift key lookout, the sprint is activated by pressing w twice within a certain time frame.

1 Like

It’s alright. Had to go to one of my more experienced scripter friend and we were STUMPED to say the least.

The answer was really concise and weird. Basically, it seemed like the loop was yielding the script, so he put the input’s actions in a function, and called it through a coroutine, so that the loop wouldn’t yield the script. He made it pretty organized and kind of explained it in a way someone like me could get. Thanks for your assistance though!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.