Help with angle and bullet - can't figure this thing out!

0 favourites
  • 3 posts
From the Asset Store
3D Car Pack 1
$2.99 USD
3D models + Rendered Low-Poly Cars in isometric, top-down, and side angles.
  • Hello.

    I've got one main project, where I am working on. Now, there's another project I created for testing.

    The test project runs just fine - this technique works as I want it to.

    However, after having copied the 'technique' to my main project, I noticed there is an unexpected result.

    This 'result' is that the bullets spawned by object 'Flak' don't head to the direction of the object B17. The bullet has a speed of 50. As soon as the object Flak is onscreen you can see it shoots to the top and slowly corrects to the direction of the B17.

    However.. when I set the speed of the Bullet fired by Flak (in my main project) higher to say, 200 speed then it will immediately fire to the center of the B17. When I set it to 100, it'll start by shooting to the right.

    And when I change the speed of the bullet down to 50 in the TEST project, it'll work just fine. Heck, I can set it to whatever I want and it will always head towards the center of the B17.

    I'm going nuts here. I've checked the imagepoints, I checked the pivot point directions, everything seems to be the same as in the test project. Well, except from a few additions like resizing etc. that I already tried disabling but still it wouldn't make any difference.

    Yet it doesn't work properly. What the hell is going on?

    So here's the code from the main project:

    And the test project:

    B17Flak.capx

    If anyone can figure this out..? I'd be really grateful!

    • R
  • There must be something else in the main project that causes this problem.

    Could you share the main CAPX? You can remove all the unrelated things from it, just leave the part with flak and bullets.

  • Try Construct 3

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

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

    Is there a reason you're setting the angle inside a "Every tick" event? Do you understand that, in this case you are re-setting the angle every tick, for every Shot, even when the angle is already set? Also, the action to set the Shot's size repeats itself a lot.

    Maybe you should consider a "On Created" event for the Shots, which would do all this (set initial size and set angle), which would make it happen imediately on creation, and leave the "Every tick" event just for adjusting the size dynamically.

    Hope it helps! Cheer!

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