Bullet and wall collision problem?

  • Im making a top down game where the player sprite has the bullet behavior and it follows the cursor wherever I click and hold. When its moving upwards against a wall it starts going faster beyond its max speed. When it moves downwards along the wall it slows down. Why does it do this and how can I keep a constant speed when moving along a wall?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • would you be able to post your capx file for this? I've done similar things for player movement but have never had this issue. Even screenshots of your events would be helpful.

  • would you be able to post your capx file for this? I've done similar things for player movement but have never had this issue. Even screenshots of your events would be helpful.

    Hi thanks for reaching out, it wont allow me to insert an image so ill just type the events out.

    Conditions: ["Touch" is in touch]

    Actions:[Set ball angle toward (Touch.X,Touch.Y)][Set ball speed to 300][Set ball acceleration to 0]

    Conditions: ["Touch" is NOT in touch]

    Actions:[Set ball angle toward (Touch.X,Touch.Y)][Set ball speed to 0][Set ball acceleration to 0]

    The balls Bullet Behavior properties: [Speed = 300][Acceleration = 0][Gravity = 0][Bounce off solids = Yes][Set Angle = Yes][Enabled]

    It follows the cursor just fine in the open but when I lure it against a solid it moves too fast along it.

  • Can anyone help? Heres a video of it I made very quick.. youtube.com/watch

  • I replicated your code and found similar results. There's something strange going on with the Bullet behavior.

    8Direction behavior doesn't appear to have these problems when moving along Solids. So I removed the Bullet behavior and used this code instead:

    (If you don't know, Vector X and Y essentially tell the ball how strongly in the X or Y direction it should move.)

    And these are the 8Direction properties I used for the ball:

  • I replicated your code and found similar results. There's something strange going on with the Bullet behavior.

    8Direction behavior doesn't appear to have these problems when moving along Solids. So I removed the Bullet behavior and used this code instead:

    (If you don't know, Vector X and Y essentially tell the ball how strongly in the X or Y direction it should move.)

    And these are the 8Direction properties I used for the ball:

    It worked and now ill be able to publish my game soon. Youre a hero Voodude, thank you so much!

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