Can't change Bullet Angle while Speed = 0

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

    I created a maze-like setup while Rings with Bullet behaviour are supposed to run around randomly.

    To handle the collisions with Walls, whenever a Ring collides with a Wall object, I ask it to set Bullet Speed to 0, then back a pixel (so it is not colliding with Wall anymore), then add a value to its current Bullet.AngleOfMotion. This added angle is a random of +90, -90, 180.

    Then I set the Bullet Speed back to normal speed.

    What I believe to be a bug is: If I leave things in the order described above, the Rings only go left and right and left and right whenever colliding with walls.

    If I invert the order of the Bullet Behaviour actions, it works properly. I mean, it works properly if, after setting Speed to 0 and snapping the Ring back a pixel further from the wall, I set the Bullet Speed to normal speed and THEN ask the Bullet Angle to be added a random angle.

    Then, the Rings correctly choose random angles and go up/down/left/right randomly when colliding with Walls.

    <img src="https://dl.dropbox.com/u/17328032/imgs/bulletorder.png" border="0" />

    <img src="smileys/smiley11.gif" border="0" align="middle" /> <img src="smileys/smiley5.gif" border="0" align="middle" /> <img src="smileys/smiley5.gif" border="0" align="middle" />

  • This has been reported a few times, but it really only makes sense the way around when you say "set speed" then "set angle of motion". When the speed is 0, it is not moving at all, let alone in any particular direction. It's to do with how the bullet calculates its movement internally. Does that make sense?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes it does make sense, I guess the angle is based on current speed vector or something like that?

    If that is the case, maybe you could set a "ghost" angle based on an always-on zero angle fake speed vector?

    <img src="smileys/smiley2.gif" border="0" align="middle" /> <img src="smileys/smiley12.gif" border="0" align="middle" /> <img src="smileys/smiley5.gif" border="0" align="middle" />

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