Advanced Paddle Design

Hello,

When designing the behaviour of the paddle I got an idea.
At the moment (in the course) the ball hits the paddle in always the same way. It hits and will be redirected (action = reaction) with always the same offset that Ben gave it in the script.

I thought what about having a paddle that redirects the ball
-0.5x when hit in the left 33percent of the paddle.
0x when hit in the middle 33 percent of the paddle.
+0.5x when hit in the right 33 percent of the paddle.

could I do this with setting up multiple colliders for the paddle GameObject or should i layer 3 GameObjects on top of each other?

Ps: As a bonus idea I also thought about making the paddle a trapeze to get the same kind of effect but i don’t know if can do that with a box collider (i should also make a new sprite if i proceed in this idea).

thanks for reading.

1 Like

If you have a look at the course list there’s a lecture on advanced collision hitboxes which is what you’re looking for. It’s pretty stand alone so you can jump ahead to it to watch without being out of step with what’s being presented and then jump back to your current point. Essentially though you remove the box collider and add a polygon one instead and then edit the shape to be a trapeze.

1 Like

Hey Malith,

My OCD is screaming as you have an unaccounted 1%! :wink:

You may also find this post of use;

If you hit the unaccounted 1 Percent The ball explodes :smiley:

but thanks for the info you linked :slight_smile:

1 Like

hehe, nice :wink:

…and you’re very welcome :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms