playMaker

Author Topic: 2D physics help: Too much bounce!  (Read 1298 times)

N00basaurus

  • Playmaker Newbie
  • *
  • Posts: 8
2D physics help: Too much bounce!
« on: January 24, 2015, 10:45:17 PM »
Hello!

I'm rather new to Unity and Playmaker and I have very VERY limited scripting experience. 

So my problem is this: I'm re-building pong.  Two "paddles" on either side of the screen that move up and down, one "ball" in the middle that bounces around.  I have a rectangular arena with box colliders and the "paddles" and "ball" have colliders + 2D rigid bodies that move about inside the arena and can not leave it.  The balls and paddles move using "add force".

As it is now, when the game starts the ball moves either left or right. But when the ball hits a paddle it knocks it back until the paddle and ball hit the wall behind before the ball bounces.  Standard, yet annoying, physics.

What I want to happen: The ball hits the paddle and bounces off.  The only motion input on the paddle should be the player.  The paddle stays stationary as the ball hits it and moves away from it. In essence: NO KNOCKBACK.

I can't use transform to move the ball or paddle as they won't stay within the arena and they "wiggle" when hitting a collider. Using add force instead of transform prevents them from wiggling and keeps the objects inside the field.

I can't use the "is kinematic" option either as that makes the object ignore colliders as well as physics options such as "add force" and "bounce".   Too bad there isn't a switch like "can be knocked back (Yes/No)". 

Anybody have any ideas?  I'd really love to see either a solution in unity inspector options or playmaker if available... blocks of code are rather difficult for me to understand unless explained out in great detail... I'm really new to coding, sorry.

Thanks for the time,
-N00basaurus