How do I apply gravity after ball bounces off?

From the Asset Store
Gravity Square is a game where I aim to reach the square at the polka dot door :)
  • Hi, I am currently working my way on how the bullet feature works and physics. I have a ball that has only bullet behavior and its spawn at X intervals.

    Each ball bounces of the pad which has only solid behavior.

    The issue am facing is when ball bounces off pad, the ball goes in opposite direction instead of falling downwards as per gravity.

    How do i force gravity on the ball so when it bounces off it slows down upward and then falls downward

    https://snipboard.io/s4nLjK.jpg

  • You need to set gravity after spawning, not before.

    So you need the ball to bounce up and down? Then just the gravity should be enough, no need to set the bullet speed or angle of motion. The ball will fall down, bounce off solid floor, go up, then fall down again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This was what I did at first but issue is when I remove the bullet angle of motion, the balls moves from left to right and not downwards

    So i changed the angle of the invisible spawning object to 90 so it forces the ball to go downwards but when it collides with the paddle, it move upwards and never comes down

  • You are doing something wrong.

    Create a new sprite, add Bullet behavior, set speed=0, gravity=100, "Set angle=no"

    Run in preview and you will see that the sprite starts to fall down.

    If you set "Bounce off solids=Yes" and add a solid floor below, the sprite will start bouncing up and down.

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