Руководство по графу анимаций/Случайные движения с атрибутом ForceFollow
Материал из CryWiki Russia
Randomized motion with 'ForceFollow' links
This tutorial, will demonstrate how to create an animation graph for motion randomization. For that, we'll use the 'ForceFollow' attribute of links.
- Create a new view and new states.
Примечание:
The 'FooRandomGate' state is a gate state which forwards the current state to one of linked states when selected.
Other states are just sample animation states for randomization.
- Set up inputs for testing.
We use the Stance input in this tutorial again.
- Set up the states as follows
- FooRandomGate
We use just the Default template because we don't need any animation for this state. Set the 'Stance' criterion to test_random.
- FooSample0
It's a force-followed state. So it doesn't need the 'Allow selection' check.
- We use the template, 'IdleOneShot'.
- FooSample1
- Same above except with a different animation string.
For this, you can use the clone utility.
- FooSample2
- Same above except with a different animation string.
- Link the states as follows
- Edit the 'ForceFollow' attributes
right-click the dot in the middle of link curve, then a popup shows as follows.
Set the Force follow chance to 1 for all 3 links. Then all 3 states have the same chance of forwarded.
- After editing, you can see a small digit right beside the dot of the link shows the value of it as follows.
Test it using 'ag_' commands
Push 'AI/Physics' button to enable the AI. 'ag_debug _target_name_' 'ag_stance test_random' You can see 3 animations are randomly played* repeatedly.