Skip to main content
‹ Back to Tutorials
Intermediate Unity

Learn how to make Games: Unity (Part 3) - Making things move with Playmaker

Jul 22, 2020
About this tutorial

Hi I'm Jerry from Bliz Studio LLC. In this video, I'll be going over how to use Playmaker to make things move. How to Make a Video Game With Unity3D and Playmaker Series: Part 1: Introduction to Unity3D - https://youtu.be/loCS3NtySaU Part 2: Installing and Using Playmaker - https://youtu.be/t4OcbX

Written Guide

Part three of the learn-to-make-games series introduces Playmaker FSMs by making a sprite move back and forth on its own using iTween. It's a gentle, foundational lesson aimed at non-coders: an FSM is a finite state machine — a visual scripting tool where each state holds actions and you think logically about what should happen when.

Add an FSM to the object

Select the rocket and, in the Playmaker window, right-click to Add FSM. You'll get a Start state and State 1. States can be renamed to whatever is informative — useful once an FSM gets complex. Add two more states and rename them Move Left and Move Right; State 1 will just be bypassed, a common habit unless you need it to check something first.

Link the states with transitions

States do nothing until they're connected. Right-click a state, choose Add Transition > FINISHED, then drag from the FINISHED marker to the next state. Wire State 1 to Move Left, Move Left to Move Right, and Move Right back to Move Left, forming a loop. On play, control hits State 1, falls through to Move Left, then bounces between left and right.

Add an iTween Move By action

Open the action browser and find iTween — a library of pre-written C# animation actions (move, rotate, scale, shake, and more) so you never write code. Drag iTween Move By into the Move Left state. Leave Game Object as Owner since the rocket owns this FSM, or specify another object to move it instead.

Understand the vector

The Vector field (highlighted to signal its importance) holds the X/Y/Z offset to move by, where each grid square equals one unit (one meter). X is left/right, Y is up/down, Z is in/out. Moving left is negative, right is positive. For Move Left, click the double-line button to type a value directly and enter -2 on X to slide two units left.

Set time, easing, and the finish event

Time controls the animation length in seconds (1 by default). Easing is strongly recommended on almost every animation — like a car accelerating from a stop rather than jumping to full speed; ease in starts fast, ease out starts slow, and ease in/out does both. Under Events, drag the Finish Event to FINISHED so the state advances when the move completes. Finally, copy the action into Move Right and change the value from -2 to +2. Pressing play shows each active state glow green as the rocket slides left, then right, in a loop — the foundation for the keyboard-controlled movement covered next.

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 →