keyboard keys wont work when Player in player box

0 favourites
  • 5 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Ive never used the tutorial before with anims, but i setup the platform demo, which basically gets you to put the player (sprite) in a playerbox so as to get it to work properly for anims etc amongst other things. Ive also setup spacebar as a simulated jump key. My problem is, is that if i enable the "Every tick->keep player(sprite) on playerbox" in event sheet, it disables the spacebar simulated key and also any other key that i might setup instead.?? but the arrow keys work fine reguardless as standard with construct for movement. As soon as i disable the keep player (sprite) on playerbox the space works again too...really odd.

    I only discovered this, because i could not understand why the anims was stopping etc at random and going into debiug i saw the playerbox, loosing the position of playersprite it was all over the place. Missed this in tutorial. So as above though, I cant understand why the keyboard is getting disabled when i enable keep player to box with the system tick.?

    I looked at the two other questions on this in forum but this really did not give me an answer?

    Im running windows 10 64bit v1607. Ive tested this using all browsers preview and also NW.js same problem. Im running Construct 2 release 243. 64bit.

    I guess im doing something wrong but i dont know what?

  • I'm a little confused by how you've worded your problem, but I'll throw some advice, see if it sticks.

    If you're trying to keep an object on top of another object, I would recommend trying the "pin" behavior. Put pin on the object that DOESN'T accept input, and at the start of the layout, set its position to the object that DOES accept input and set the pin. Then put your arrow keys/space bar input on the object without the pin.

    Pin automatically sets position/angle according to the object it was pinned to. Hope that helps!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • mm ok thx, ill try this as well....Yes, for now, ive simply just removed the playerbox as suggested in the tutorial and used just the player sprite and connected anims and keys/space to it and it works fine. it does say in the tutorial that, (Pages 4 + 5) https://www.scirra.com/tutorials/253/ho ... ame/page-4 that one should use it though the playerbox, but as soon as i set it move with the playersprite as in the tutorial using the system tick interrupt event it would not move with a spacebar key setup to jump as well as above only the arrow keys would make it jump, really odd. Ill try the pin and see how i go as an option then.

  • Do you have the platform behavior attached to both ? To box & animation ?

  • Oh wow. Okay. That tutorial is from 2012. Holy crap.

    So instead of making the object reposition to the empty box every tick, instead, use the pin behavior as I explained above. Try putting the platform behavior on both, but with Pin I don't actually think that's a good idea, as at best the Pin will make the game ignore the animation's jump behavior, and at worst, it will double jump for every press.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)