Question by
ProgrammerAdam12 · May 19, 2018 at 04:55 PM ·
c#inputvariables
Keyboard Input Not Working For Certain Keys At Certain Points
if(forwardrightwalk){
if(Input.GetKey("d") && Input.GetKey("w") && Input.GetKey("s")){
cannotmoveforward = true;
movingright = true;
cannotmovesideways = false;
cannotmovediagonal = true;
}
else{
cannotmovesideways = false;
cannotmovediagonal = false;
}
}
Hey guys, I was looking at creating my moving cancellations for my game (e.g. if a and d are pressed don't move). It was all going well until I looked at using the keys below for cancelling. For some reason, while I am moving forward right with "d" and "w", the "s" key is undetected at all. Thanks for any help, I will be active to answer questions. If you need more code to look at, feel free to ask.
Comment