Hello everyone, I'm Qin Yuanpei. Welcome to follow my blog. My blog address is blog.csdn.net/qinyuanpei.
Thanks for your support. In the previous article "[Unity3D] Unity3D game development-imitation fairy sword and legend pass role control effect", we used custom scripts to Implement role controllers in RPG games, of course, this role is not complete yet, and there are still some problems and deficiencies in collision and control. For these problems, I will give you a detailed description in a later article, and try to design a role controller for RPG games to facilitate the development of RPG games. So what I want to share with you today is a very important component in Unity3D-Ragdoll ). Let's take a look at the picture first!
I believe that my friends who are familiar with xianjian must know the following sentence: victory, defeat, and defeat. Please come again. From xianqianyi to xianqianyi, xianqianyi brings us not only ups and downs, but also touching stories, but also the courage to start from the ground up after every failed battle. Sometimes, like games, we always encounter setbacks and difficulties. Although under the world view of the five spirits and six worlds like xianjian, humans basically exist as the weakest and smallest life, do we always strive to do it? Therefore, we must actively and passionately do one thing in our life. What bloggers hate most is the type of players who only have their mouths left after playing games. The game must have a loss or a win. I would like to ask which of the following xianjian players have not been abused by the Boss, but isn't the game fun about surpassing itself over and over again? It is not terrible to lose. What we fear is that we lose the courage to work hard because of losing. I think xianjian has always passed a positive energy like us, that is, we must make ourselves brave. There are many things in our life that we may not be able to control, just like Li Xiaoyao's exclusive sword skill, but he cannot help Ling er escape fate, yuntianhe has the spirit of X-Dragon, Houyi shot Sun's bow, and arrows shot Qiong Hua to save the people below the hill, however, she could not save her beloved girl's life. She thought she could do everything right with all her heart, but in the end she had to stab her sister with a dagger, just to prevent the dead wood from occupying her body. Maybe we don't know what the future will look like, but at least at this moment, we have worked hard and done something with great care. That's enough. Now, we will not comment on these players. We will officially start today's content.
In RPG games, when the role HP is reduced to 0, the role enters the dead state, and the role will be put to the ground. In the past game design, the actions of a role falling to the ground were usually completed by the animators drawing certain animations. This method is simple, but because the actions of the role falling to the ground are the same, it cannot reflect attacks on a role in real time. Therefore, in the game development field, a new model, Ragdoll, is gradually formed to simulate the death of a role. In Unity3D, the system provides us with doll components. Let's take a look at how to use dolls to simulate the death of a role:
First, create a new project, and create a Plane and parallel light in the scenario. Next, import the FBX model we have prepared. In the game scenario, we should see the following content:
Next, we select the model, and create a doll component for it:
Let's take a look at the displayed dialog box:
If the skeleton animation is provided in our model, you can click the select button on the right to find the corresponding file, and then click Create, in this case, the skeleton component under the model should look like the following:
We will remove the box collision and set the animation of the model to None. Now let's run the program:
We can see that our role is actually down to the ground, and if we run the program multiple times, we will find that the role is different every time it dies, this greatly enhances the sense of realism of the game. If the posture of death in each battle is the same, will it become visual fatigue? Although the market reaction of xuanyuan Sword 6 is not very good, thanks to the powerful physical engine in Unity3D, every time a monster dies, it is quite amazing. You can play the trial version on your own, haha. I hope that the subsequent works of the legend of xianjian and Qixia will be able to pay attention to this issue. As a hero, we are dying to death. Well, this is today's article. I hope you will like it!
If you like my blog, please remember my name: Qin Yuanpei. My blog address is blog.csdn.net/qinyuanpei.
Reprinted please indicate the source, Author: Qin Yuanpei, the source of this article: http://blog.csdn.net/qinyuanpei/article/details/23869275