Skip to content

Commit d69aee6

Browse files
update Open Source Docs from Roblox internal teams
1 parent 71d467c commit d69aee6

File tree

7 files changed

+240
-54
lines changed

7 files changed

+240
-54
lines changed

content/common/navigation/platform.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ navigation:
3535
path: /production/publishing/about-GDPR-and-CCPA
3636
- title: DMCA
3737
path: /production/publishing/dmca-guidelines
38+
- title: Generative AI
39+
path: /generative-AI
3840
- title: AI data sharing
3941
path: /ai-data-sharing
4042
- title: Account verification

content/en-us/animation/graph-editor.md

Lines changed: 160 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ Animation graphs is currently in Studio Beta. To enable, navigate to **File** >
2727

2828
To begin building logic for an animatable character, access the Animation Graph editor via the Avatar tab in the Studio ribbon. The following steps demonstrate how to initialize a rig and construct a basic node network using default walking and waving animations.
2929

30-
For a deeper dive into practical applications, you can explore the Animation Graph Reference File, which contains both foundational and complex implementation examples.
30+
For a deeper dive into practical applications, you can explore the [Animation Graph Reference File](https://www.roblox.com/games/92493993350916/Animation-Graph-Editor-Simple-Demo), which contains both foundational and complex implementation examples.
3131

3232
To create your own animation graph, similar to the basic example provided in the reference, use the following steps:
3333

3434
1. In Studio, add an animatable rig by navigating to the Avatar tab and selecting **Character** > **My Avatar**.
35-
2. Open the Animation Graph Editor by navigating to **Avatar** > **Anim Graph**.
35+
2. Open the Animation Graph Editor by navigating to **Graph Editor** in Studio's **Avatar** tab.
3636

3737
<img src="../assets/animation/graph-editor/Anim-Graph-Ribbon.png" width="60%" alt="Animation Graph Editor indicated in Studio's toolbar" />
3838

@@ -127,40 +127,11 @@ For all nodes and [transitions](#transitions), the following rules apply by defa
127127
- Nodes without custom event logic pass all events through unchanged; nodes that blend or select between inputs may scale the weight or block events from non-primary inputs (see per-node Event section).
128128
- Marker events that reach the top of the graph can be observed via `Class.AnimationTrack:GetMarkerReachedSignal`.
129129

130-
### Transitions
131-
132-
Several nodes in the Animation Graph (such as **Select**, **Priority Select**, **Sequence**, and **Random Sequence**) manage how animations blend when switching between active inputs. To prevent redundancy in the node reference, these behaviors are defined by standardized transition property groups.
133-
134-
<dl>
135-
<dt>**Default Transition**</dt>
136-
137-
<img src="../assets/animation/graph-editor/Transition-Default.png" width="60%" alt="Default Transition" />
138-
139-
<dd>
140-
The baseline blending behavior applied to the node whenever it switches to a new active input.
141-
<ul>
142-
<li>**DefaultTransitionDuration** (Number): The time (in seconds) it takes to fully blend into the new pose.</li>
143-
<li>**DefaultTransitionCurve** (`Enum.PoseEasingStyle`): The easing function applied during the blend. Currently only supports `Enum.PoseEasingStyle.Linear` and `Enum.PoseEasingStyle.CubicV2`.</li>
144-
</ul>
145-
</dd>
146-
<dt>**Transition Override**</dt>
147-
148-
<img src="../assets/animation/graph-editor/Transition-Override.png" width="60%" alt="Transition Override" />
149-
150-
<dd>
151-
Input-specific link properties that supersede the Default Transition. These are applied when the node transitions <em>to</em> that specific input.
152-
<ul>
153-
<li>**TransitionOverrideDuration** (Number): Overrides the default transition duration.</li>
154-
<li>**TransitionOverrideCurve** (`Enum.PoseEasingStyle`): Overrides the default transition curve. Currently only supports `Enum.PoseEasingStyle.Linear` and `Enum.PoseEasingStyle.CubicV2`</li>
155-
</ul>
156-
</dd>
157-
</dl>
158-
159130
### Clip
160131

161-
<img src="../assets/animation/graph-editor/Clip-Node.png" width="230px" alt="Clip node" />
132+
<img src="../assets/animation/graph-editor/Clip-Node.png" width="30%" alt="Clip node" />
162133

163-
A reference to an `Class.AnimationClip` asset. This serves as a leaf node in the graph, generating the raw animation data that is fed into other nodes for blending, selection, or modification.
134+
A reference to an `Class.AnimationClip` asset. This serves as a leaf node in the graph, generating the raw animation data that feeds into other nodes for blending, selection, or modification.
164135

165136
<dl>
166137
<dt>**Inputs**</dt>
@@ -232,7 +203,7 @@ A reference to an `Class.AnimationClip` asset. This serves as a leaf node in the
232203

233204
### Select
234205

235-
<img src="../assets/animation/graph-editor/Select-Node.png" width="230px" alt="Select node" />
206+
<img src="../assets/animation/graph-editor/Select-Node.png" width="30%" alt="Select node" />
236207

237208
Selects between any number of inputs via the Selection property. Whenever the current selection changes, it triggers a new [transition](#transitions).
238209

@@ -268,7 +239,7 @@ Selects between any number of inputs via the Selection property. Whenever the cu
268239

269240
### PrioritySelect
270241

271-
<img src="../assets/animation/graph-editor/Priority-Select-Node.png" width="230px" alt="Priority Select node" />
242+
<img src="../assets/animation/graph-editor/Priority-Select-Node.png" width="30%" alt="Priority Select node" />
272243

273244
Evaluates a list of connected inputs from top to bottom and plays the first one whose condition evaluates to true. This allows for hierarchical animation selection based on specific logic. Whenever the current selection changes, it triggers a new [transition](#transitions).
274245

@@ -313,7 +284,7 @@ Evaluates a list of connected inputs from top to bottom and plays the first one
313284

314285
### Sequence
315286

316-
<img src="../assets/animation/graph-editor/Sequence-Node.png" width="230px" alt="Sequence node" />
287+
<img src="../assets/animation/graph-editor/Sequence-Node.png" width="30%" alt="Sequence node" />
317288

318289
Activates connected inputs in a specific sequential order based on defined wait conditions. Whenever the current selection changes, it triggers a new [transition](#transitions).
319290

@@ -362,9 +333,9 @@ Activates connected inputs in a specific sequential order based on defined wait
362333

363334
### RandomSequence
364335

365-
<img src="../assets/animation/graph-editor/Random-Sequence-Node.png" width="230px" alt="Random Sequence node" />
336+
<img src="../assets/animation/graph-editor/Random-Sequence-Node.png" width="30%" alt="Random Sequence node" />
366337

367-
Selects and plays one of its connected inputs at random. When the currently selected animation completes, the node randomly picks another input to play. Each input can be assigned a specific weight to influence the probability of it being chosen. Whenever the current selection changes, it triggers a new [transition](#transitions).
338+
Selects and plays one of its connected inputs at random. When the currently selected animation completes, the node randomly picks another input to play. Assign each input a specific weight to influence the probability of it being chosen. Whenever the current selection changes, it triggers a new [transition](#transitions).
368339

369340
<dl>
370341
<dt>**Inputs**</dt>
@@ -404,7 +375,7 @@ Selects and plays one of its connected inputs at random. When the currently sele
404375

405376
### Over
406377

407-
<img src="../assets/animation/graph-editor/Over-Node.png" width="230px" alt="Over node" />
378+
<img src="../assets/animation/graph-editor/Over-Node.png" width="30%" alt="Over node" />
408379

409380
Layers the **Over** pose on top of the Base pose. When combined with a Mask node, masked-out joints in the **Over** pose reveal the **Base** pose entirely, creating a transparent overlay effect.
410381

@@ -446,7 +417,7 @@ Layers the **Over** pose on top of the Base pose. When combined with a Mask node
446417

447418
### Add
448419

449-
<img src="../assets/animation/graph-editor/Add-Node.png" width="230px" alt="Add node" />
420+
<img src="../assets/animation/graph-editor/Add-Node.png" width="30%" alt="Add node" />
450421

451422
Adds the **Additive** pose to the **Base** pose, attenuated by a specific **Weight** (unclamped).
452423

@@ -483,7 +454,7 @@ Adds the **Additive** pose to the **Base** pose, attenuated by a specific **Weig
483454

484455
### Subtract
485456

486-
<img src="../assets/animation/graph-editor/Subtract-Node.png" width="230px" alt="Subtract node" />
457+
<img src="../assets/animation/graph-editor/Subtract-Node.png" width="30%" alt="Subtract node" />
487458

488459
Converts an animation into an additive pose by subtracting a relative base pose from the target pose ($A - B$). The result is attenuated by a specific **Weight** (unclamped).
489460

@@ -520,7 +491,7 @@ Converts an animation into an additive pose by subtracting a relative base pose
520491

521492
### Blend1D
522493

523-
<img src="../assets/animation/graph-editor/Blend1D-Node.png" width="230px" alt="Blend1D node" />
494+
<img src="../assets/animation/graph-editor/Blend1D-Node.png" width="30%" alt="Blend1D node" />
524495

525496
Linearly interpolates between the two animation poses closest to the current input position on a single axis.
526497

@@ -568,7 +539,7 @@ Linearly interpolates between the two animation poses closest to the current inp
568539

569540
### Blend2D
570541

571-
<img src="../assets/animation/graph-editor/Blend2D-Node.png" width="230px" alt="Blend2D node" />
542+
<img src="../assets/animation/graph-editor/Blend2D-Node.png" width="30%" alt="Blend2D node" />
572543

573544
Blends multiple animation poses together based on two input parameters within a 2D coordinate space. This generalizes the Blend1D node to handle complex scenarios, such as blending based on both movement direction and speed simultaneously.
574545

@@ -633,7 +604,7 @@ Blends multiple animation poses together based on two input parameters within a
633604

634605
### Mask
635606

636-
<img src="../assets/animation/graph-editor/Mask-Node.png" width="230px" alt="Mask node" />
607+
<img src="../assets/animation/graph-editor/Mask-Node.png" width="30%" alt="Mask node" />
637608

638609
Applies a predefined mask to the input Pose. A mask is defined by a weight per object (e.g. joint) in the rig hierarchy, allowing for precise control or "feathering" of the animation.
639610

@@ -685,7 +656,7 @@ Applies a predefined mask to the input Pose. A mask is defined by a weight per o
685656

686657
### Speed
687658

688-
<img src="../assets/animation/graph-editor/Speed-Node.png" width="230px" alt="Speed node" />
659+
<img src="../assets/animation/graph-editor/Speed-Node.png" width="30%" alt="Speed node" />
689660

690661
Modifies the playback rate of an incoming animation pose.
691662

@@ -721,7 +692,7 @@ Modifies the playback rate of an incoming animation pose.
721692

722693
### GraphOutput
723694

724-
<img src="../assets/animation/graph-editor/Graph-Output-Node.png" width="230px" alt="GraphOutput node" />
695+
<img src="../assets/animation/graph-editor/Graph-Output-Node.png" width="30%" alt="GraphOutput node" />
725696

726697
Represents the final evaluated pose of the graph. This node is automatically included in all new graphs in the Animation Graph Editor. Its presence ensures that the graph is always valid and consistently produces an animation pose.
727698

@@ -740,3 +711,146 @@ Represents the final evaluated pose of the graph. This node is automatically inc
740711
- **Event Emission:** This node serves as the exit point for the animation pipeline and does not emit signals back into the graph.
741712
</dd>
742713
</dl>
714+
715+
## Transitions
716+
717+
Several nodes in the Animation Graph (such as **Select**, **Priority Select**, **Sequence**, and **Random Sequence**) manage how animations blend when switching between active inputs. To prevent redundancy in the node reference, these behaviors are defined by standardized transition property groups.
718+
719+
### Default transition
720+
721+
<img src="../assets/animation/graph-editor/Transition-Default.png" width="60%" alt="Default Transition" />
722+
723+
The baseline blending behavior applied to the node whenever it switches to a new active input.
724+
725+
- **DefaultTransitionDuration** (number): The time (in seconds) it takes to fully blend into the new pose.
726+
- **DefaultTransitionCurve** (`Enum.PoseEasingStyle`): The easing function applied during the blend. Currently only supports `Enum.PoseEasingStyle.Linear` and `Enum.PoseEasingStyle.CubicV2`.
727+
728+
### Transition override
729+
730+
<img src="../assets/animation/graph-editor/Transition-Override.png" width="60%" alt="Transition Override" />
731+
732+
Input-specific link properties that supersede the default transition. These are applied when the node transitions **to** that specific input.
733+
734+
- **TransitionOverrideDuration** (number): Overrides the default transition duration.
735+
- **TransitionOverrideCurve** (`Enum.PoseEasingStyle`): Overrides the default transition curve. Currently only supports `Enum.PoseEasingStyle.Linear` and `Enum.PoseEasingStyle.CubicV2`
736+
737+
## Replication
738+
739+
Animation graph parameters are local to each `Class.AnimationTrack` and are not automatically replicated. This may change in future updates, but the currently recommended approach uses:
740+
741+
- **Client → Server**: A `Class.RemoteEvent` to send parameters from the owning client to the server at a fixed tick rate.
742+
- **Server → Other Clients**: Instance **attributes** which automatically replicate to all clients.
743+
744+
### Player characters
745+
746+
A client script drives player characters. Since only the owning client knows the current gameplay state (movement input, humanoid state, etc.), parameters must flow from the owning client to the server and then to all other clients.
747+
748+
<h4>Setup</h4>
749+
750+
Under `Class.StarterCharacterScripts`, create:
751+
752+
- A `Class.LocalScript` for client-side animation and parameter driving.
753+
- A `Class.Script` for server-side replication.
754+
- A `Class.RemoteEvent` for client-to-server communication.
755+
756+
<h4>Client script</h4>
757+
758+
The owning client drives parameters from gameplay events and sends them to the server periodically. Other clients read replicated attributes from the server script instead.
759+
760+
```lua
761+
local Players = game:GetService("Players")
762+
local RunService = game:GetService("RunService")
763+
764+
local character = script.Parent
765+
local humanoid = character:WaitForChild("Humanoid")
766+
local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid
767+
768+
-- Load the animation graph
769+
local animation = Instance.new("Animation")
770+
animation.AnimationId = "rbxassetid://YOUR_GRAPH_ID" -- Replace with your published graph ID
771+
local track = animator:LoadAnimation(animation)
772+
track:Play()
773+
774+
local isLocalCharacter = Players:GetPlayerFromCharacter(character) == Players.LocalPlayer
775+
776+
if not isLocalCharacter then
777+
-- Read replicated parameters from the server script
778+
local animateServer = script.Parent:WaitForChild("AnimateServer")
779+
780+
for attribute, value in animateServer:GetAttributes() do
781+
track:SetParameter(attribute, value)
782+
end
783+
784+
animateServer.AttributeChanged:Connect(function(attribute)
785+
track:SetParameter(attribute, animateServer:GetAttribute(attribute))
786+
end)
787+
return
788+
end
789+
790+
-- Local player: drive parameters from gameplay
791+
local params = {}
792+
793+
local function setParam(key, value)
794+
track:SetParameter(key, value)
795+
params[key] = value
796+
end
797+
798+
-- Example: drive parameters from humanoid state
799+
humanoid.Running:Connect(function(speed)
800+
setParam("Speed", speed)
801+
setParam("State", if speed < 0.1 then "Idle" else "Moving")
802+
end)
803+
804+
-- Send parameters to the server at a fixed tick rate
805+
local replicateEvent = script.Parent:WaitForChild("ReplicateEvent")
806+
local TICK_RATE = 1 / 20
807+
local lastSendTime = 0
808+
809+
RunService.Stepped:Connect(function(gameTime)
810+
if gameTime - lastSendTime > TICK_RATE then
811+
lastSendTime = gameTime
812+
replicateEvent:FireServer(params)
813+
end
814+
end)
815+
```
816+
817+
<h4>Server script</h4>
818+
819+
Receives parameters from the owning client, drives the server-side animation graph, and propagates values as attributes for replication to other clients.
820+
821+
```lua
822+
local Players = game:GetService("Players")
823+
824+
local character = script.Parent
825+
local humanoid = character:WaitForChild("Humanoid")
826+
local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid
827+
828+
-- Load the same animation graph on the server
829+
local animation = Instance.new("Animation")
830+
animation.AnimationId = "rbxassetid://YOUR_GRAPH_ID" -- Same graph ID as client
831+
animation.Parent = script
832+
local track = animator:LoadAnimation(animation)
833+
track:Play()
834+
835+
-- Receive parameters from owning client and replicate via attributes
836+
local replicateEvent = script.Parent:WaitForChild("ReplicateEvent")
837+
838+
replicateEvent.OnServerEvent:Connect(function(player, params)
839+
if Players:GetPlayerFromCharacter(character) ~= player then
840+
return
841+
end
842+
843+
for key, value in params do
844+
track:SetParameter(key, value)
845+
script:SetAttribute(key, value)
846+
end
847+
end)
848+
```
849+
850+
### NPCs
851+
852+
Since the server owns NPC animation, only server-to-client replication is needed. Drive the animation graph on the server, write parameters as attributes on a server Script, and read them on clients using the same `Class.Instance.AttributeChanged` pattern shown above.
853+
854+
### Latency
855+
856+
Other clients see animations with a small delay equal to the tick interval (up to 50 ms at 20 Hz) plus network latency. You can reduce the tick interval by increasing the frequency (such as 1/30), at the cost of higher network traffic. 20 Hz is a reasonable default; animation blending is forgiving enough that small delays are hard to notice.
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)