Skip to main content
โ€น Back to Tutorials
Intermediate Unity

Making a Mobile Bounce Game with Unity 3D and Playmaker - Rotating the Paddle

Jan 17, 2021
About this tutorial

Beginner Game Design tutorial series creating a simple Bounce type game using Playmaker within Unity 3D. PART 11 - In this video, I set up rotation of the paddle as the paddle moves left and right. Absolutely NOCODE. Also make a skateboard game playlist: https://bit.ly/34m4SHT ๐Ÿ‘‰๐Ÿผ To Sign up for

Written Guide

After last episode's particle effects, this one adds feel to the paddle itself: instead of sliding flat across the screen, the paddle now tilts as it travels โ€” rotating up toward the right edge and the opposite way on the left. It's a small touch that makes the controller feel dynamic, and it's built with three Playmaker actions.

Step 1 โ€” Keep rotation in its own FSM

The controller already has a Move Controller FSM that reads Get Mouse X and sets the paddle's local transform. Rather than bolting rotation onto it, add a second FSM on the same game object โ€” use the dropdown next to the FSM name and Add FSM โ€” and name it Rotate Controller, renaming it in the inspector too. Two reasons: movement and rotation stay untangled so each can be tuned independently, and when a game object carries several FSMs, real names beat a stack of entries all labeled "FSM" when you need to find or disable one at a glance.

Step 2 โ€” Read the mouse position

In the new FSM, add a Get Mouse X action and store the result in a new float variable called rotate. With the debug area turned on you can watch the value change in the Variables tab as the cursor moves โ€” a quick sanity check that the input is flowing before you wire it to anything.

Step 3 โ€” Rotate around the right axis

Add a Set Rotation action. Picking the axis is worth a second of thought: rotating on X would tip the paddle toward the camera, rotating on Y would flip it up and over โ€” the Z axis is the one that tilts it the way a paddle should lean as it moves. Feed the rotate variable into the Z angle field and check Every Frame so the tilt tracks the mouse continuously.

Step 4 โ€” Multiply for a usable angle

First test: the paddle barely tilts, because the raw mouse X value only spans a small range across the screen. The fix is a Float Multiply inserted between Get Mouse X and Set Rotation โ€” order matters, since the chain is read the mouse, scale the number, then apply it. Multiply rotate by 10 (into the same rotate variable, every frame) and test again: now the tilt is obvious but slams too hard at the screen edges. Cut it in half to 5 and the motion lands in the natural-feeling middle โ€” enough lean to read, not enough to feel twitchy. That multiplier is your tuning knob; adjust to taste.

The pattern, and what's next

The whole system is get mouse X, float multiply, set rotation โ€” three actions running every frame in a dedicated FSM. It's the same read-input-then-apply pattern the movement FSM uses, just pointed at rotation instead of position, which is exactly why keeping them separate works so cleanly. Next episode tackles touch controls, so the game starts behaving like the mobile title it's meant to be.

Unity tools by Bliz Studio
Built for our own games — now on the Asset Store

Multi Tag — unlimited hierarchical tags for any GameObject. Hierarchy Pro — style your whole hierarchy with rules. Made by a Unity dev, for Unity devs.

Explore our Unity assets →