纳金网

标题: unity3d第三人称角色控制教程-5 [打印本页]

作者: 会飞的鱼    时间: 2011-12-9 15:24
标题: unity3d第三人称角色控制教程-5
Slope Limits



If you've sculpted some terrain (such as hills or cliffs) then you will notice that the character can walk up even a sheer vertical incline, which is impossible; so we want to prevent this. It is actually very easy to set a slope limiter to prevent the character walking up an incline of x degrees, because the character controller component we attached to the character has a slope limiter built in, its just got a very steep allowance at the moment.
1. Select the character in the Hierarchy

2. Under the character controller section in the Inspector look for "Slope Limit"

It has a default of 90 degrees, which is pretty steep, so lets change it to 40-50 degrees. Now if you havent done so already, sculpt some geometry onto your terrain and test it out, adjusting the slope limit until you feel its at a comfortable limit for your game.
Now in part 6 we shall be concluding our tutorial with a quick discussion on controllers and some final thoughts.
So you've completed the bulk of the 3rd person character controller tutorial, while it works pretty well its very basic and will want extending... which was kind of the point of this tutorial; to provide the bare bones; basic controller for you to extend for your games as opposed to bogging you down in game specific mechanics.
If you understood the code in the script you should be able to add more actions now, like if you have a punch animation how to read in a button press to play that animation and how to add some logic into the script; things like that.
This final section mentions some final thoughts.


Final Thoughts



Follower Cameras

While the follower camera works, you do need to consider camera collision; but to do that you need a grasp on other mechanics which are outside of the scope for this tutorial, we'll be adding an advanced camera control tutorial very soon so watch this space.
Reading Animation Time

Its useful to know how to read in the time of an animation for when you perform actions; its quite simple, this code will return the duration of an animation:
animationTime = animation["name_of_animation"].clip.length;
Applying Textures to your Character

We didn't cover how to apply textures to your character; this is quite simple and is the same for any model import. Import the textures individually, open the materials and apply the texture for each material in the Inspector.
由 u8  发表


作者: 菜刀吻电线    时间: 2012-1-22 23:25
节气交替,温差变幻;天气寒冷,注意流感;多加衣服,适时添穿;不为瘦身,只为保暖;关怀送上,短信祝愿:平安快乐,健康过年!

作者: 奇    时间: 2012-1-22 23:29
鉴于你今年的良好表现,新年将至,别人都在祝福你新年快乐,我觉得换一种新颖的方式祝福你,那就是:天天开心,事事顺利,雷打不动的祝福属于你!

作者: C.R.CAN    时间: 2012-1-28 23:19
一帆风顺,二龙腾飞,三羊开泰,四季平安,五福临门,六六大顺,七星高照,八方来财,九九同心,十全十美。

作者: 菜刀吻电线    时间: 2012-6-2 23:24
我是老实人,我来也!

作者: tc    时间: 2012-6-7 23:21
先垫一块,再说鸟

作者: tc    时间: 2012-6-28 23:27
都闪开,介个帖子,偶来顶

作者: C.R.CAN    时间: 2012-10-18 23:26
其实楼主所说的这些,俺支很少用!

作者: 菜刀吻电线    时间: 2013-2-10 23:22
凡系斑竹滴话要听;凡系朋友滴帖要顶!

作者: 菜刀吻电线    时间: 2013-2-18 23:26
有意思!学习了!

作者: tc    时间: 2013-3-14 23:42
发了那么多,我都不知道该用哪个给你回帖了,呵呵





欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5