One final tweak
One small adjustment stands between you and a fun keep-up game mechanic. We want the paddle to angle in the opposite direction to keep the ball bouncing inside the play area. We can multiply by -1
to flip the effect:
var tiltAroundX : float = Input.GetAxis("Mouse Y") * tiltAngle * -1;
Save and test. Hooray! The paddle tilts around the play area inclusively, keeping the ball more or less within our reach—unless we get twitchy, and then we drop the ball. But that's the fun of keep-up—moving the paddle just so as to keep the ball in play.
What's a quaternion?
Well, that was lots of fun! We've got a working keep-up game mechanic. Now let's go and do something else.
Wait, what's a quaternion?
Oh, that? Don't worry about it. We have bigger fish to fry! In the next chapter, we'll…
WHAT THE HECK IS A QUATERNION??
Gosh, you're persistent. Can't you just leave it well enough alone?
I'm not going to sugarcoat it: 3D math is complex. A quaternion (like the one we used in our rotation code just...