In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the example analysis of Unity animation system, the article is very detailed, has a certain reference value, interested friends must read it!
State Machine and State Machine Design
The state machine of the role takes layer 0 as the main layer, and then switches around the standby hybrid tree.
There will be some complex hybrid trees in the main layer, which can make action fusion through parameter adjustment, such as eight-direction Straft.
There will also be a node in the main layer dedicated to Override, which will be mentioned later.
In the sub-level, it is used for action fusion of unconventional behavior, such as fighting while walking and defense while walking. Cymbal
Animation event
Animated events are not much useful, mainly in the case of marking what logic needs to be triggered at a certain frame of the animation. Such as the pull of RootMotion and so on. I prefer to write my own logic to time rather than give it to animated events.
An animation event that triggers an event at a certain frame of the animation. If the event may fail during the animation transition, a more robust approach is to customize the time period.
State events, state machine switching events, but still their own calculation is more reliable and simple.
IK
There are many IK algorithms. Generally speaking, CCD is used when the performance is good, and FRAB is used if the effect is required. There are a lot of materials on the Internet.
In the open world, there are many interactive objects that are pre-typed with TAG. For example, the climbing IK calculates the nearest action point on the trigger object and performs the corresponding IK operation.
IK naturally has a lot of corner case if he wants to do it, such as moving around, bad zone and so on. There is a lot of information that can be found on GDC.
Retarget
Retarget is a piece of animation that can be applied to other models.
Unity can retarget based on the node name. This feature is supported by a random clip.
For general-purpose humanoid animation humanoid is more friendly, the name is not the same, you can still retarget through avatar.
If you want to do retarget in other forms, you can use Morpheme middleware.
Replacement system
Here are some changing plans.
The simplest thing is to change the material level, such as changing the map.
The way of dummypoint is also very simple, make a prefabricated hang point on a good character, and then change the weapon.
Static skinning, make several sets of skinned clothes on the model in advance, and switch on and off mesh when changing.
Dynamic skinning, re-binding skinning allows characters to change clothes. As long as it is developed based on the same set of bones, and then re-assign bone information when changing, the rebinding skinning can be completed. If you use a set of materials, you can also reduce Drawcall by merging Mesh.
Support pinch face, refer to uma system. The principle is that the vertices of the finished parts are spliced together and skinned. Pinching the face is also an operation on vertex bones.
RootMotion
Using RootMotion makes animation more natural (some games glide because you can't use RootMotion), and there are many projects that separate the RootMotion output art path and use it. But RootMotion is static, and some tricks are needed to make RootMotion more natural in a dynamic environment.
In the case of dynamic displacement, we often encounter situations where the RootMotion cannot reach the destination, so the most common operation for RootMotion is to scale it to the appropriate displacement.
In the case of dynamic rotation, it will also be encountered that the rotation angle of the RootMotion does not meet the needs of the game or because of the mixed offset. One way is to approximate the angle by blending parameters to control the animation to rotate to the right angle.
Override
Generally speaking, we can replace it directly through AnimatorOverrite. But if there is a transition between the actions of multiple Override, then the Unity will cause the character to penetrate the ground. You can use the following scheme to support any number of Override animation transitions.
The three state machines act as placeholder, replacing the unused nodes for each replacement, and then transitioning. After replacement, you need to refresh it with Animator.Update.
The advantage is to increase the reuse rate of a single AnimatorController and reduce the number of clip involved in animation state and initialization.
Physical animation
Unity's animation system is very simple, does not support complex state machines, can not add IK, physics and other nodes, nor can it nest hybrid trees. Here you can adjust the bones again after the final animation system output, such as LateUpdate.
Dynamicbone, a plug-in that adds an effect to a specified bone to make a bone vibrate.
Puppet, the solution for this plug-in is similar. After the animation output, the physical system corrects the ragdoll according to the position of the animation, and then calculates the ragdoll back to the bone after the physical collision, thus allowing the character animation to interact well with the physical environment.
Performance problem
Animator initializes stutter, and Animator loads AnimationClip in all states into memory. The best way is to use Override to reduce unnecessary loading.
Animation compression, can be preprocessed by itself, under the control of the accuracy can save a lot of space. Other methods can also be considered, such as omitting channels, curve degradation, bone culling, and so on.
The above is all the content of this article "sample Analysis of Unity Animation system". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.