Help with a Physics Problem

BenjaBenja Member Posts: 3
edited November -1 in Working with GS (Mac)
Hi, everyone!

For my first Gamesalad endeavor, I'm working with kind of a Breakout/Blasterball idea. I've got my little paddle to launch the ball, but whenever it launches the ball it is knocked back, and subsequent hits of the ball will make the paddle slide downward ever so slightly until a button is pressed and the paddle moves again.

I have Restitution set to 0 on the Player (which by the way is using a circle collider instead of a rectangle) and it has a density of 100. The ball has a Restitution of 1 and a density of .4.

Any thoughts on why my player/paddle is being knocked back at launch and sliding away after other collisions?

Comments

  • applaudmobileapplaudmobile Member Posts: 208
    Do you use rotate to move the paddle or is it animated? If you don't use rotate you can turn physics off which will stop it moving down. Otherwise try a higher density or constrain the paddle to a fixed Y position (assuming it slides left and right)
  • SkyMapleSkyMaple Member Posts: 817
    If you want to constrain the paddle's Y position do this-

    Make a new integer attribute inside of the paddle actor called initY (for initial Y position)
    *Change attribute initY to self.position.Y
    *Constrain attribue self.position.Y to initY

    _______________________________
    Follow me on Twitter!
    https://twitter.com/SkyMapleGames
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Im not sure if you saw but there is actually a Block breaker templet included with GameSalad for you to practice and learn from. It can also be used as the base strting point for your game if you see fit. Just make sure not to just rip off the template. Make it yours with art sounds and some special twist to the gameplay.

    Enjoy. :)
  • BenjaBenja Member Posts: 3
    Okay!

    Thanks, everyone. I managed to fix the Y axis so it wouldn't bounce down. It started bouncing across instead, so I gave it a density of 1000 and we're good. It still hiccups a bit at launch, but I can always tweak exactly where the ball instantiates from to fix that. Thanks for your help!

    And yes, I scoured that Block breaker template but couldn't find the answer I needed. It's been very helpful in a lot of other spots, though!
Sign In or Register to comment.