Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Input problem, input trigger repeating?[SOLVED]

Hi guys,

I have a strange problem in a script I'm working on. A bit of background: in this part of the script, the actor command window is separated into up to four separate ones (one for each character present). I'm getting there, but the problem I have encountered is in switching between windows with the Left/Right keys.

Without going into too much detail, this functionality is very temperamental. I have got to the point where it is theoretically working right. However in practice you can get stuck on the first actor's command window until they perform an action, and then you are stuck on the next actor's window until they perform an action or the first actor becomes available again, etc.

HOWEVER, this functionality works perfectly when I insert 'print' commands in a few places, just to tell me certain values along the way. I get my popup, press OK, and you go to the next command window as intended!

But when I remove the print commands, it no longer works!

Has anyone encountered a similar problem before? Could it be something to do with the input being processed too quickly? My left and right commands are both set up to use Input.trigger? rather than Input.press? or Input.repeat?.

Any thoughts would be greatly appreciated.
 
d_disaster":20pt0lah said:
My left and right commands are both set up to use Input.trigger? rather than Input.press? or Input.repeat?.

Sorry, my post is rather long so I understand if you didn't read all the details :P I'm not using repeat or press, I'm using trigger. I did actually try press, but it made things worse, as one would expect.
 
Sorry if I wasted anybody's time, but I solved the problem on my own! For anybody interested, turns out I had a part of my frame update code which meant that the command window update method got called one extra time (after pressing right or left), purely my fault due to a dodgy if statement in there. Nothing wrong with input.trigger? at all :D
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top