A mood is a type of facial animation for animatable heads that loops indefinitely, allowing users to express themselves and react to others with a persistent facial emotion. Moods play simultaneously with other character default animations, such as walking, climbing, and swimming, and if the default animation has a facial animation, the default animation blends with the character's mood.
Creating Moods
If you have a character model with an animatable head, you can create any mood animation you can think of using the Face Animation Editor. If you don't want to use the Blocky or Goblin reference character models, you can create or modify an existing model to support animated heads in a third-party modeling software, such as Blender or Maya. For information on how to create an animatable head, see Creating Basic Heads.
To create a mood:
Add a character model with an animatable head to the viewport.
Open the Face Animation Editor.
In the menu bar, navigate to the Avatar tab.
In the Animation section, click on the Animation Editor. The Animation Editor window displays.
In the viewport, select your character model with an animatable head. A dialog displays.
In the Animation Name field, enter a new animation name, then click the Create button. The Animation Editor window displays the media and playback controls, timeline, and track list.
In the track list of the Animation Editor, click the Face button. The Face Animation Editor displays to the left of the track list.
In the Face Animation Editor, adjust sliders for the facial parts you want to manipulate. Animation tracks for each facial part you manipulate automatically display in the track list along with keyframes for your current position in the timeline. The character's face also updates in the viewport.
- To undo a step on a slider, press CtrlZ (⌘Z).
- To redo a step on a slider, press CtrlY (⌘Y).
- To reset a slider to its default value, right click on the slider. A contextual menu displays. Select Reset Selected.
When you are finished creating your animation, navigate to the Media and Playback Controls and click the … button. A pop-up menu displays.
Select Save or Save As to save the mood animation. The animation displays in the Explorer window as a child of the AnimSaves object (itself a child of the rig).
(Optional) To assign an asset ID to your mood animation and save it to the Toolbox to use across your experiences,
In the Explorer window, right-click on your new mood animation. A contextual menu displays.
Select Save to Roblox. The Asset Configuration dialog displays.
Fill in the following fields:
- Title: A name for your plugin.
- Description: A description that describes what a potential user should expect the plugin to do.
- Creator: The creator you'd like to attribute as the creator of the plugin.
Click the Submit button. After a moment, the Asset Configuration dialog displays your mood's Animation.AnimationID that you can use to set the mood to characters within your experiences.
Setting Moods
Every character with an animatable head has a child Animate LocalScript with a child mood StringValue that contains the mood animation that plays on the character's head. The mood animation's default Animation.AnimationID plays a smiling animation, but you can change the character's mood to something else by either directly editing the Animation.AnimationID within the mood StringValue, or using the HumanoidDescription system.
Editing AnimationIds
You can set a specific mood for each character within your experience by editing their mood's Animation.AnimationID whenever a user triggers an event. For example, the following Script edits any previously set mood to an animation that opens the character's mouth as soon as the user enters the experience:
local Players = game:GetService("Players")
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
local animateScript = character:WaitForChild("Animate")
animateScript.mood.Animation1.AnimationId = "rbxassetid://7715145252" -- Mood
end
local function onPlayerAdded(player)
player.CharacterAppearanceLoaded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)
Using the HumanoidDescription
You can also use the HumanoidDescription system to find user characters and edit their AnimationIDs for any default animation. For example, the following Script edits any previously set mood to an animation that gives the character a half-smile on the left-side of their face whenever their character is idling:
local humanoid = player.Character and player.Character:FindFirstChildWhichIsA("Humanoid")if humanoid thenlocal descriptionClone = humanoid:GetAppliedDescription()descriptionClone.IdleAnimation = 10725833199-- Apply modified "descriptionClone" to humanoidhumanoid:ApplyDescription(descriptionClone)end
Disabling Moods
To disable moods from your experience, you can delete the mood object underneath the Animate LocalScript. For example, the following Script removes every character's mood StringValue as soon as they join the experience:
local Players = game:GetService("Players")
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
local animateScript = character:WaitForChild("Animate")
animateScript.mood:Destroy()
end
local function onPlayerAdded(player)
player.CharacterAppearanceLoaded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)