How do I make my gun face away from me?

0 favourites
  • 5 posts
From the Asset Store
JBoB Sound Studio presents 107 high-quality sound effects in this Gun SFX Pack
  • I failed

    My pinned gun works when i face to the left, but is behind me when i face right.

    If I hold the walk left button (A) then try walking to the right (D) while holding A,

    the gun points away instead of behind me. I need this scenario everytime.

    But if I hold the walk right (D) button first and then try to walk left (A) , my sprite mirrors and my gun faces backwards

  • basically your event is remembering the old press down what i did was instead of press down i use press released that usually solve it.

  • This didn't help, I have alot of events that govern the gun direction so i'm confused, I uploaded this so that I remember this thread

    My capx file:

    http://www.filedropper.com/wedjun1538am2016

    I'll take another look at my event sheet before i say that I've tried everything

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey SimShady,

    I had a look at your capx and the issue you are having comes from a few places. For a start off you have a ton of redundant/conflicting events for your gun control. I would remove practically all of them. Second you are trying to tie the direction of the gun to a keypress, which is in my experience a bad way of doing it. I usually tie the keypress to the direction of the character and then the direction of the character to the gun.

    I messed with your capx and ended up with the screenshot below - this gives you a responsive correct gun position. I'm not saying this is perfect though <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> I didn't have long. Maybe someone else will come up with something better!

    http://i.imgur.com/2KTixKM.png

  • Why not shift the guns origin on the X-as ?

    Then you can spawn the gun on the players position.

    You can pin it.

    Or set it to that position every tick.

    Mirror it when you mirror the player.

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