3rd Person Unity Playmaker Magic Attack Idle Start Stop
In this 3rd Person in Unity and Playmaker tutorial, I'll be set up an idle charging magic attack start and stop using the new input system Press and Release button input. Then when starting magic, I'll spawn the charging particles and destroy when back to idle. ► Download Playmaker at https://bit.
This third person tutorial sets up an idle charging magic attack in Unity with Playmaker, using the new Input System's press and release button input. Holding a button starts the magic charge with a particle effect, and releasing it stops the charge and destroys the particles, returning the character to idle. The prefabs for the magic charge and magic bolt were made in a prior tutorial, so the focus here is input, animation, and spawning.
Preparing the Animator
On the player model's Animator, parameters are set up for attack, attack position, and idle. From any state there is a transition into the magic idle animation with no exit time, conditioned on the attack position trigger. A second transition leads from magic idle back to the idle walk run blend with no exit time, conditioned on idle. So triggering attack position enters the charge pose, and triggering idle leaves it.
Defining Press and Release Input
Open the player input actions and create a new action named magic idle of type Button. Add an interaction by clicking plus; mobile projects might use multi tap, slow tap, or tap, but for an Xbox controller choose Press, then change its behavior from Press Only to Press And Release so both holding and letting go fire. Set the binding by using Listen and pressing the B button, which registers as Button East, then save.
Wiring the Input in Playmaker
On the player, which already has player move and passive interact FSMs, add a new FSM labeled magic. Its first state, listen, uses a Player Button Event action set to the magic idle action with an Is Pressed event sending a new magic idle event. Before clicking the missing transition warning, add a global transition for magic idle so it can be reached from anywhere. Copy the Player Button Event into a second action, clear the pressed option, and instead use Was Released This Frame to send a stop magic event, also wired as a global transition. Add a finished transition from stop magic back to listen.
Triggering the Animation
In the magic idle state add a Set Animator Trigger action targeting the model and firing attack position, which plays the charge pose. Copy it into the stop magic state but set it to the idle trigger so releasing the button returns to idle walk run. A quick test confirms holding B enters the pose and releasing it returns to idle.
Spawning and Destroying the Particles
Inside the model, create an empty named magic spawn so it can later be animated with the hand. Use the animation rigging effector and the magic idle animation preview to position it near the hand. In the magic idle state add a Create Object action that spawns the magic charge prefab parented to the magic spawn point, storing the result in a new variable named magic charge. In stop magic, add a Destroy Object action that destroys the object referenced by that magic charge variable, then return to listen. Now holding B charges the particle effect at the hand, and releasing it destroys the effect and returns the character to idle.





