Animation: the Animation Editor, Moon Animator, Animator

Learn Roblox animation from the wrench swing. Author keyframes in the Animation Editor, compare Moon Animator 2 and Blender, play tracks with Animator, set priorities and weights, use markers, and publish with the right owner.

Tool lesson, about 80 minutes, 13 steps

By the end you can

  • Author a short swing in the Studio Animation Editor and publish it to the right owner
  • Load and play it from a LocalScript with Animator and AnimationTrack, and know when it replicates
  • Choose a priority, blend with weights, and fire gameplay from an animation event marker
  • Pick between the Animation Editor, Moon Animator 2 and Blender for a job

Before this: The wrench: tools, raycasts, tags

Step 1 of 13

The swing you see is a separate thing

Swing the wrench and two different things happen. The server raycasts and decides the hit. Your own device plays an arm movement so the swing looks like a swing. The movement is decoration; the hit never waits for it.

A swing at m06. The arm motion is an animation played on the client.

Transcript
  1. 0:00 The server accepted the swing, so the swing sound can play.
  2. 0:01 The include list is only the Drone tag. The ground is not a hit.
  3. 0:04 The bar stays where it was.

At m06-drone-wrench the arm motion comes from an uploaded animation whose id lives in Ids.WRENCH_ANIMATION_ID (m07-feel renames this key to WRENCH_SWING_ANIMATION). The repo ships that id as 0, and then the swing plays no animation at all and prints one [Ids] warning. This lesson is how you make your own, and how m07-feel re-authors it.

Choose one

You run Beacon Yard with WRENCH_ANIMATION_ID still 0. What happens when you swing?

You run Beacon Yard with WRENCH_ANIMATION_ID still 0. What happens when you swing?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 2 of 13

Rigs, poses and keyframes

An animation moves the joints of a RigRigA model whose parts are joined by movable joints, so an animation can pose it.Think of it as a puppet with hinges at every joint.: a model whose parts are connected by joints such as Motor6D or bones. Roblox characters come in two rigs. R15 has 15 body parts, with elbows and knees. R6 is the legacy rig with 6 parts. Studio's Rig Generator (Avatar > Character or Home > Character) inserts either, and only R15 can wear layered clothing1.

An animation is a list of poses on a timeline. You pose the rig at one moment, move the scrubber, pose it again, and the editor fills the motion in between. Each stored pose of a part is a keyframe. Studio animates at 30 frames per second by default, so 0:15 on the timeline is half a second2.

Choose one

Your game uses players' own avatars, many of which wear layered jackets. Which rig should you animate the swing on?

Your game uses players' own avatars, many of which wear layered jackets. Which rig should you animate the swing on?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 3 of 13

The Studio Animation Editor

The Animation Editor opens from Studio's Avatar tab (or Window > Avatar). Select a rig, then:

  1. Scrub to a frame and rotate a joint. A keyframe appears on that part's track. Press R to switch between move and rotate.
  2. Right-click keyframes to set an easing style (Linear, Constant, CubicV2, Elastic, Bounce) and direction (In, Out, InOut).
  3. Use ⋯ > Set Animation Priority and the Looping button.
  4. Save keeps a KeyframeSequence in ServerStorage. That is your working file, not something the game should play.
  5. ⋯ > Publish to Roblox uploads it and gives you an asset id. Pick the group in the Creator field if a group owns the game.
Roblox Studio
Beacon Yard during Play with the wrench held in the character's right hand at its resting pose before a swing.

Select a numbered pin, or a row below, to read what it marks.

The resting pose the swing starts from in Play. Your authored swing raises this arm back, snaps it forward to the Impact marker, and settles back here.

Put in order

Put the workflow for a new wrench swing in order.

  1. Set easing on the keyframes and the priority to Action
  2. Insert an R15 rig and select it in the Animation Editor
  3. Put the asset id in Ids.local.luau and press Play
  4. Publish to Roblox under the experience's owner
  5. Pose the start, the wind-up and the impact on the timeline

Link to this step · This confused me

Step 4 of 13

Animation Editor, Moon Animator 2 or Blender

The built-in editor is enough for a 0.4-second swing. Studios also use two other tools, and pick by the job.

Where Roblox animators work

OptionWhat it isWhen pros pick itTrade-offs
Studio Animation EditorRoblox's built-in keyframe editor, with a curve editor, IK and animation events.Most gameplay animations: swings, emotes, idles. Free and always up to date with the engine.Fewer layering and camera tools than dedicated packages.
Moon Animator 2A paid Creator Store plugin for animating inside Studio.Cutscenes and animations that move cameras, lights and several rigs together. Common among Roblox-native animators.A one-person third-party plugin: you depend on it being maintained, and its project files are its own.
BlenderA free, open-source 3D suite; you animate a rig and export FBX.Studios with 3D artists, complex characters, and teams that also model in Blender.The rig must match Roblox's joint names, and every change is an export and an import.
MayaAutodesk's commercial animation package, used across the games industry.Animators coming from console or film pipelines; Roblox documents a Maya export path.A paid licence and the same FBX round trip as Blender.

FBX animations from Blender or Maya come in through the editor's ⋯ > Import > From FBX Animation, onto a rig whose joints use Roblox's names3. After that they publish like anything made in Studio.

Match the pairs

Match each job to the tool most teams would reach for first.

Link to this step · This confused me

Step 5 of 13

Animator plays an AnimationTrack

To play an animation from code you need three objects. An Animation holds the asset id. The Animator, a child of the character's Humanoid, loads it and returns an AnimationTrack. The track is what you play, stop, speed up and listen to4.

	local function playSwing(character: Model)
		local animationId = Ids.asset(Ids.WRENCH_ANIMATION_ID)
		if animationId == nil then
			return
		end
		local humanoid = character:FindFirstChildOfClass("Humanoid")
		if humanoid == nil then
			return
		end
		local animator = humanoid:FindFirstChildOfClass("Animator")
		if animator == nil then
			local created = Instance.new("Animator")
			created.Parent = humanoid
			animator = created
		end
		if swingTrack == nil then
			local animation = Instance.new("Animation")
			animation.AnimationId = animationId
			local loaded, track = pcall(function()
				return animator:LoadAnimation(animation)
			end)
			if not loaded or typeof(track) ~= "Instance" then
				return
			end
			swingTrack = track :: AnimationTrack
		end
		swingTrack:Play(0.05, 1, 1.35)

Play(fadeTime, weight, speed) fades the track in over fadeTime seconds to weight, at speed times normal5. The wrench uses a 0.05-second fade, full weight and 1.35 times speed.

Work it out

Suppose your swing animation is 0.6 seconds long at speed 1. playSwing plays it at speed 1.35. How long does one swing take, in seconds? Round to two decimals.

seconds

Link to this step · This confused me

Step 6 of 13

Who sees your animation

Animations break a rule you learned early: that a client's changes never travel up. The Animator handles replication itself. If the Animator belongs to a player's character, animations that player's client plays are replicated to the server and to every other client. Anything else, such as an NPC, must be animated from the server6.

Both sidesRemember: Replication is the live broadcast.

There is one catch. The Animator itself must be created on the server. The Roblox docs say that tracks loaded on an Animator created locally do not replicate. Read playSwing again: when no Animator is found, it creates one on the client.

Choose one

playSwing runs on a character whose Humanoid has no Animator, so it creates one with Instance.new on the client. Who sees the swing?

playSwing runs on a character whose Humanoid has no Animator, so it creates one with Instance.new on the client. Who sees the swing?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 7 of 13

Priorities and blending

While you swing, the default walk or idle animation is also playing. Both want to move your arm. Priority settles it. From highest to lowest: Action4, Action3, Action2, Action, Movement, Idle, Core. Roblox's default character animations play at Core, and the rest are yours7. For each joint, the engine evaluates tracks from high priority to low and stops once the weights add up to 1. Tracks at the same priority blend by weight: two Action tracks that both move the same arm, at weights 0.5 and 0.5, give a half-and-half pose, and the level 3 test's blend_same_rank checks exactly this. The cell below only models the stop rule.

Luau
Ctrl Enter runs the cell. Checked against the expected output
Predict the output

In the cell, change Swing's weight to 0.5. What does the model print for Walk?

{ name = "Swing", rank = 4, weight = 0.5 }
In the cell, change Swing's weight to 0.5. What does the model print for Walk?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 8 of 13

Animation events ring a doorbell

A swing has a moment that matters: the impact. You can mark it on the timeline as an animation event, say Impact. In code, track:GetMarkerReachedSignal("Impact") returns a signal that fires each time playback passes that marker, with an optional parameter string8. Sound and sparks can wait for it.

A signal is a doorbell. Connect wires a function to it, and every ring runs the function. The animation rings the Impact bell when it reaches the marker.

Think of it as A doorbell

Both sidesRemember: An event and :Connect is a doorbell.

Markers are for presentation. The server must never wait for an Impact marker to apply damage: the marker fires on the client, and a cheater's client can fire it whenever it likes, or never.

Find the broken line

After twenty swings, each impact plays the clang twenty times. Which line causes it?

After twenty swings, each impact plays the clang twenty times. Which line causes it?

Press 1 to 5 to choose, Enter to check.

Link to this step · This confused me

Step 9 of 13

Uploading and ownership

A published animation is an asset with an owner, either you or a group. Roblox only plays it in a game that is allowed to use it: one owned by the same creator, or one you have granted permission to from the asset's Permissions page on the Creator Dashboard9. If the game belongs to a group, publish the animation to that group. An animation published to your personal account will not play in a group's game unless you grant it.

In Beacon Yard the id never goes in a commit. You put it in src/shared/Ids.local.luau, which Git ignores, and Ids.luau merges it over the default 0.

Choose one

Your team's game is owned by a group. You paste in the ID of a Restricted personal animation without granting the game access. What do players see?

Your team's game is owned by a group. You paste in the ID of a Restricted personal animation without granting the game access. What do players see?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 10 of 13

Where the doorbell picture breaks

A doorbell rings once per press and you hear it once. Signals are not that tidy. Answer first, then open the breakdown.

Where does it break?“A doorbell” is a good picture of an event and :connect. Where does it stop being true?

It breaks here. One visit can ring many times (Touched fires per body part), handlers have no promised order, and a chime you never unwire keeps ringing: connections leak until you disconnect them.

The true model. An RBXScriptSignal calls every connected handler each time it fires, possibly deferred to the next resumption point. Handlers must tolerate repeats and must be disconnected when their owner goes away.

Choose one

CombatClient loads swingTrack the first time you swing and never clears it. You die and respawn with a new character. Which Animator does the next swing's track belong to?

CombatClient loads swingTrack the first time you swing and never clears it. You die and respawn with a new character. Which Animator does the next swing's track belong to?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 11 of 13

Build it: re-author the swing for m07

  • src/client/CombatClient.luau
  • src/shared/Ids.luau
  • src/shared/Ids.local.example.luau
  1. In a new Baseplate, open Avatar > Character (or Home > Character) to launch the Rig Generator and insert a Block Rig, R15.

    You should see An R15 rig named Rig appears at the origin of a new Baseplate.

  2. Open the Animation Editor, select the rig and pose the right arm: rest, raised back, swung forward.

    You should see Three keyframes on the RightUpperArm and RightLowerArm tracks: rest at 0:00, wind-up at 0:06, impact at 0:12. Playback swings the arm in under half a second.

  3. Show animation events from the timeline settings, move the scrubber to 0:12, and add an event named Impact.

    You should see A marker named Impact sits on the event track at 0:12.

  4. Set the priority with ⋯ > Set Animation Priority > Action.

    You should see The priority menu shows Action ticked.

  5. Publish with ⋯ > Publish to Roblox, choosing the owner of your copy of Beacon Yard as the Creator.

    You should see Asset Configuration closes and the editor shows the new asset id.

  6. Check out m07-feel, copy Ids.local.example.luau to Ids.local.luau if you have not, and set WRENCH_SWING_ANIMATION (at m06-drone-wrench the key was named WRENCH_ANIMATION_ID; m07-feel renamed it).

    You should see Ids.local.luau holds WRENCH_SWING_ANIMATION = your id, and git status does not list the file.

  7. Press Play and swing. Then reset your character from the Roblox menu and swing again. With the m06 code the cached track still belongs to the old character; m07 loads a fresh track per Animator so this step passes.

    You should see Swinging plays your new arm motion. After you reset your character, the next swing still animates.

Link to this step · This confused me

Step 12 of 13

Challenges

Level 1, Apprentice

Challenge

Slow the swing to half speed and see that gameplay does not change.

Start from
m07-feel, with your own WRENCH_SWING_ANIMATION

Done means

  • At speed 0.5 the swing is visibly slow, and hits still land at the same rate
  • The speed is 1.35 again afterwards

Meet the criteria above, then record your own result. No test grades this check.

Level 2, Builder

Challenge

Time the swing sound to the impact frame.

Start from
m06-drone-wrench, with your own swing published with an Impact marker

Done means

  • The swing sound plays at the Impact marker, not at the click
  • Twenty swings still play one sound per swing
  • Damage is still decided by the server raycast

Meet the criteria above, then record your own result. No test grades this check.

Choose one

A teammate suggests applying wrench damage when the server hears that the Impact marker fired. Why is that a bad idea?

A teammate suggests applying wrench damage when the server hears that the Impact marker fired. Why is that a bad idea?

Press 1 to 4 to choose, Enter to check.

Level 3, Professional

Challenge

Fix the respawn bug and model blending in challenges/animation_work.luau on m14-ship. The check models animation tracks without loading an animation. Press Play and run game.ServerScriptService.RunGameTests:Invoke("animation") in the server command bar.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("animation") in the server command bar. Copy the pass code from Output.

Done means

  • challenges/animation_work.luau caches one track per Animator and reloads for a new Animator
  • Its blend function follows the priority and weight rule from this lesson
  • challenges/animation.luau prints TEST PASS for track_cached, track_per_animator, blend_override, blend_share and blend_same_rank

The Course Runner prints this code when the test passes.

Link to this step · This confused me

Step 13 of 13

Recap

Recap

  1. An animation is posed keyframes on a rig (R15 or legacy R6), authored in the Animation Editor, Moon Animator 2 or Blender, and published under the owner of the game.
  2. Animator:LoadAnimation returns an AnimationTrack; tracks a player's client plays on its own character replicate, but only on a server-created Animator.
  3. Priority decides which track moves a joint, weights blend tracks, and markers fire signals that time effects, never damage.

An event and :Connect is a doorbell, until one visit can ring many times (Touched fires per body part), handlers have no promised order, and a chime you never unwire keeps ringing: connections leak until you disconnect them.

Replication is the live broadcast, until only property changes in some containers are sent, and nothing a client changes ever travels back up to the server.

Next NPCs and pathfinding: the scrap crawler

Link to this step · This confused me