Bullet behavior: Angle only sets if speed is greater than 0

0 favourites
  • 4 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Problem Description

    I found that the Set angle of motion action only sets the angle for the bullet behavior if the speed is greater than 0. I'm not sure that this is indeed a bug, however I found no information about this in the manual and I couldn't figure out till now what is causing this issue.

    If you set a speed first for the object with the behavior and try to change the angle of motion only after that, it works fine. I think this should either be fixed (to be able to set the angle at 0 speed) or documented to avoid confusing other developers. It also concerns the Custom Movement behavior.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/166 ... angle.capx

    Description of Capx

    In the capx there are 2 sprites with 4 instance variables each and a bullet behavior (speed set to 0). I set the start and destination point coordinates at the beginning of the layout into these variables, then I use the angle() expression to calculate the angle for the bullet behavior using the data from the variables. The "Sprite" object gets the angle first and then I set the speed to 100, which results in a movement at angle 0. However he "Sprite1" object gets the speed set first and then the angle set. This object moves in the correct angle.

    Steps to Reproduce Bug

    • Create and object with 4 instance variables (for starter and destionation coordinates) and a bullet behavior (speed set to 0).
    • In the event sheet, set the angle of motion for the bullet behavior using the angle() expression with the 4 variables.
    • In the event sheet, set the speed for the bullet behavior to a non-zero value.

    Observed Result

    The behavior ignores the angle set and starts moving in angle 0 (or -180).

    Expected Result

    The behavior should be able to set the angle of motion even at speed 0.

    Affected Browsers

    • Chromium (Opera): (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 10 with latest updates

    Construct 2 Version ID

    r202.2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "The bullet's angle of motion is based on it's x and y velocity. If a bullet isn't moving then what is it's angle of motion? "

    So when the bullet isn't moving, it's angle of motion = 0 and it's angle gets set to 0.

    (i made the same mistake a couple of years ago )

  • RamPackWobble Thank you for clearing that up for me. But I still believe, it should be in the manual.

  • Closing as by design.

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