Using Parameters to Adjust the Animation During Runtime
You can adjust the SimulatedObject node to change its animation during runtime. To do so, create a Parameter node and attach them to the node in the anim graph. If you don’t, the SimulatedObject node uses the properties that you entered in the Attributes panel.
To adjust the animation during runtime
In the Parameters panel, click the + icon and choose Add parameter.
Enter the following values:
- For Value type, select the `Float (slider)``.
- For Name, enter
Stiffness
. - For Default,
enter 1.0
. - For Minimum to
1.0
. - For Maximum, enter
100
.
Your parameter should look like the following.
Click Create.
Repeat Steps 2 and 3 but change Name to
Gravity
, Default to1.0
, Minimum to0
and Maximum to5
.Repeat Steps 2 and 3 but change Name to
Damping
,Default
to1.0
, Minimum to1
and Maximum to100
.Repeat Steps 2 and 3 but change Name to
Weight
, Default to1
, Minimum to0
and Maximum to1
.Your parameters should look like the following.
In the Anim Graph grid, right-click and choose Create Node, Sources, Parameters.
On the Parameters0 node, connect the Stiffness output to the Stiffness factor, the Gravity output to the Gravity factor, and so on.
Your graph should look like the following.
Pay the anim graph and adjust the sliders for the Parameters to view your changes.
Note
The simulated object, simulated joints, and parameters on the anim graph share the following properties: Stiffness, Gravity, Damping. When you adjust the properties, the Animation Editor calculates the results of these properties using the following:
- Stiffness factor parameter * simulated object stiffness * simulated joint stiffness
- Gravity factor parameter * simulated object gravity * simulated joint gravity
- Damping factor parameter * simulated object damping * simulated joint damping