bullet keeps going diagonal of the direction its supposed to go

0 favourites
  • 8 posts
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • im working on a game like zelda, the sword is supposed to shoot kindof a beam, but it wont stop going about 45 degrees extra of where it should shoot. the beam uses bullet behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Make sure the bullet image is aligned properly in the animation editor. The default orientation for all sprites in Construct is 0 degrees, which means they should be facing right or "East".

    If this doesn't help, please share your project file or a screenshot of the event sheet.

  • sorry dop2000, i dont think i was specific enough, or i didnt understand what you meant, the problem wasnt the animation, but the bullet direction of the beam (example:i want it to move at 0 degrees, but it moves at 45, or i want 90 degrees, but its 135 and so on). i got a couple pictures of this here:

    the coding:

    the preview:

  • Well, from what I can see, you set the sword angle to 45 degrees, spawn a bullet, then set bullet angle of motion to sword.angle - that's why it moves at 45 degrees.

    .

    A few other things - you are using the signals wrong. It makes no sense to send a signal on every tick.

    And you don't need to "Pick last created" in event #40. The bullet instance gets automatically picked in event 39 when you spawn it.

  • thank you! ill try to fix those

  • so i got the 45 degree problem fixed, but now its only going to the right, i got the screenshots here:

    coding:

    preview:

    i think these are the right screenshots

  • It's difficult to tell what is wrong without a project file.

    Run the game in Debug Mode (Shift+F4), then you will be able to check how many sword instances there are on the layout (should be just one), check all angles, animation etc.

  • SOLVED

    thanks for the help dop2000! i figured out what was wrong. when the sword first spawns, it starts at 0 degrees, then goes to the correct angle as soon as the spawn finishes. the swordshot would spawn before the angle change happens because the two events happened at the same time. so what i did was i put the "signal" action at the end of every "set angle to" for the sword, then a "wait for signal" before the "spawn object" so that the swordshot always spawns after the swords angle is set. in case that didnt make sense, i have a screenshot here on the code that i made that made the game work:

    i think this is it

    its events 39-43 in the screenshot that i was talking about above, and i put the rest of that code group in along with it.

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