How do I fix this bullet angle error?

  • Hello.

    Well, the tile is self explanatory. Nothing really to say here.

    Once I aim the gun on the left side while my character is turned to the left side and shoot it, the bullets go to the right side instead of the left.

    I've tried using the "Set Mirrored" event and some other stuff but it didn't work for some reason.

    Here's the image of some of the gun event stuff:

    .capx link:

    mediafire.com/file/fskrw9d3k8qe9r5/Platformer.capx

    EDIT: I forgot to mention that the gun is aimed with the mouse, and not just the A and D keys.

  • Vodakman on the "is not mirrored" sub event after you spawn the bullet just ad another action bellow : "set bullet speed" to -600 wich is the speed you choose for your bullet but with - so the bullet travels to the opposite direction

  • Vodakman

    tarek2

    setting bullet speed to a minus value won't fix the sprite. I usually set the angle of the bullet to the player angle after spawning.

    1. Spawn bullet

    2. Set angle of bullet to player angle

    This should rotate the bullet 180° if player is mirrored.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Vodakman

    tarek2

    setting bullet speed to a minus value won't fix the sprite. I usually set the angle of the bullet to the player angle after spawning.

    1. Spawn bullet

    2. Set angle of bullet to player angle

    This should rotate the bullet 180° if player is mirrored.

    MACPK normally you are right, i tried that first with his capx but it didnt work, i was tired and i didnt notice that the gun is the one pointing in the wrong angle when the player is mirrored

  • Yeah, I forgot to mention that the gun is aimed by the mouse, if that's the problem.

    Also, another problem happens when I'm mirrored, the gun aims weirdly, not sure why though.

  • Yeah, I forgot to mention that the gun is aimed by the mouse, if that's the problem.

    Also, another problem happens when I'm mirrored, the gun aims weirdly, not sure why though.

    Vodakman yea a noticed that today, I done a quick fix let me know if is that what you need

    new capx: https://www.dropbox.com/s/841hbugbxvtw30l/Platformer2.capx?dl=0

  • > Yeah, I forgot to mention that the gun is aimed by the mouse, if that's the problem.

    > Also, another problem happens when I'm mirrored, the gun aims weirdly, not sure why though.

    >

    Vodakman yea a noticed that today, I done a quick fix let me know if is that what you need

    new capx: dropbox.com/s/841hbugbxvtw30l/Platformer2.capx

    Yeah, that's it, thanks!

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