Help to set up physics for ball game

0 favourites
  • 6 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Im trying to use physics for a ball game and struggled with one annoying issue with the physics

    The ball with high elasticity has bounce noise, it is always bouncing at a small speed, which looks like shaking, and most annoying it never stops bouncing

    I want to keep the rubber effect but this noisy bouncing kills the effect

    May be somebody knows how to setup the physics right

  • The ball should settle into place naturally by using the physics object and you can set the friction and mass inside the properties of the physics behavior. I think the problem must lie in the movement logic somewhere that is competing with the physics behaviors ability to settle. May I ask how this ball gets into motion and if you modify the motion after that point?

  • The ball should settle into place naturally by using the physics object and you can set the friction and mass inside the properties of the physics behavior. I think the problem must lie in the movement logic somewhere that is competing with the physics behaviors ability to settle. May I ask how this ball gets into motion and if you modify the motion after that point?

    Sure, I checked all settings, What unusual I did, was change the gravity of the physics, to 40, the default is 200 as I remember, I need a faster physics

    And this is what i have at the end

    Subscribe to Construct videos now
  • Remember that both the ball and the bricks have a friction and mass, you can raise the friction to the point where there is no bounce so there should be a middle ground. Try raising the friction to a higher amount for an easy fix.

    OR

    When the ball and the bricks collide try an event that says "If velocityX + velocityy is less than 40" then ball velocity X = ball velocity X / 2 (halved) and the same for Y in another event. That will severely drain the ball of it's velocity when you approach the settling that you are trying to get rid of. Raise the number higher than 2 if this isn't enough.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Remember that both the ball and the bricks have a friction and mass, you can raise the friction to the point where there is no bounce so there should be a middle ground. Try raising the friction to a higher amount for an easy fix.

    OR

    When the ball and the bricks collide try an event that says "If velocityX + velocityy is less than 40" then ball velocity X = ball velocity X / 2 (halved) and the same for Y in another event. That will severely drain the ball of it's velocity when you approach the settling that you are trying to get rid of. Raise the number higher than 2 if this isn't enough.

    I did something like this, and it is working, but there are some issues as well. For example, it can remove the bounciness completely. I resolved it, but bouncing stops after jump and not after moving (which I do by rotating the ball)

  • you should create a debug text:

    Create a layer on top for GUI with a parallax of 0% x 0%, place a text object there and at the end of your events put

    system>every 0.1 second condition

    and action

    of set text with the text object

    Set the text to something like "VelocityX: " & ball.physics.xvelocity & newline & "VelocityY: " ball.physics.yvelocity

    This will allow you to see exactly what cutoff point you want to force the object to sleep because you only want to take away a settling bounce, which should have a different velocity level of any kind of bump from moving along regularly.

    Eliminate anti-settle when torque:

    Since you are moving using torque you might want to add that to your debug info list because you won't be trying to force a settle if the ball is still rotating.

    Slow motion for debug if needed:

    do a start of layout events set time scale if needed to put the project into slow motion. Then with our anti-settling events disabled (D in editor while highlighted) try letting the ball settle in slow motion and picking the degree at which you want to cut it off at to still allow regular bumps from movement.

    Isolate Y Velocity:

    A suggestion is that you are really fighting gravity here so no point in really taking into consideration X Velocity so you might want to single out Y velocity for this one.

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