纳金网

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

作者: 会飞的鱼    时间: 2011-12-9 15:23
标题: unity3d第三人称角色控制教程-5(上)
If you've been following our 3rd person character controller for Unity tutorial so far you will have a playable character in your game world, however there are two flaws with the system we have created.
1. The camera does not follow the character.

2. The character can walk up very steep/sheer inclines on the terrain.
Of course we shall now address both of these issues.


Camera Following



When the character is walking we want the camera to follow the character from behind. There are three common ways of doing this:
1. Dragging the Main Camera in the Hierarchy onto the character prefab in the Hierarchy, which binds the camera to the controller.

2. Creating a smooth follower camera, which is bound to the character

3. Creating an orbital camera.
The first method is the easiest, just drag the camera in the hierarchy onto the character in the hierarchy to set the camera as a child of the character. This is easy and works if you want to test it out. However the movement is a bit harsh, its not the nicest follower.
With the second method, we apply a smooth follow component to the camera and attach it to the character, which results in a much nicer follower.
The third method is a bit more complex and will be the subject of another tutorial which is coming soon. So we will implement the second method in this tutorial. So follow these simple steps:
1. Select the camera in the hierarchy

2. Select Component -> Camera Control -> Smooth Follow
This has applied a smooth follow component to the camera, we now need to attach it to the character.
1. Select the Main Camera in the Hierarchy.

2. In the Inspector look for the Smooth Follow script section pictured below.

3. Set the target to the character transform.

If you test the game now the camera will follow the character but will be out of position; so we need to set the cameras position.
So set the Height and Distance settings of the smooth follow camera so that it is in the desired position. When you've got it in the right place test the game, you'll find that the camera now follows the character and smoothly moves with the character and not harshly which makes for a much more pleasant camera motion.


作者: 难骑    时间: 2012-6-8 15:07
提示: 作者被禁止或删除 内容自动屏蔽
作者: 驰骋的风    时间: 2012-6-15 09:21

手枪烧烤车


盔甲外套



充气式保暖夹克衫



水下也可使用的太阳能电池板



简洁长绳壁挂



宏伟的人工树林



变色创可贴



真空吸附式爬墙利器

作者: 难骑    时间: 2012-6-15 14:26
提示: 作者被禁止或删除 内容自动屏蔽
作者: 铁锹    时间: 2012-6-16 09:22

    3D魔幻艺术展将在杭州开展

   

    iPhone 4已经能成功运行3D地图
   
     
     
   
   
    全国首款3D移动网游《怪物大作战》正式上线
     
     
   
   
    虚拟现实_华丽投资_席卷财富
     
     
   
   
    曼恒数字2012虚拟现实由南京展开6月巡展
     
   
   

作者: C.R.CAN    时间: 2012-7-1 23:25
有意思!学习了!

作者: 铁锹    时间: 2012-7-6 10:26

    [Unity3d技术交流] unityl
    unity3d起重机(吊车)模拟(uni
    [Unity3d教程] 几本Unity3
    unity 3d 游戏开发工具 3.5
    [unity3d相关下载] GUI插件(比较容易上手) EZ_GUI_1.076

作者: BU Secret    时间: 2012-7-6 15:08
好好好好好好好好好好好好好好好
作者: Eleven    时间: 2012-7-6 15:17
单反系好盆友的帖子都要顶!
作者: 艺术家    时间: 2012-7-6 15:48
好好好好好哈好哈哈哦
作者: 艺术家    时间: 2012-7-6 15:48
好好好好好哈好哈哈哦
作者: 难骑    时间: 2012-7-20 17:36
提示: 作者被禁止或删除 内容自动屏蔽
作者: tc    时间: 2012-7-28 23:20
很经典,很实用,学习了!

作者: 奇    时间: 2012-8-22 00:15
呵呵,真得不错哦!!

作者: 晃晃    时间: 2012-8-30 00:03
读铁系缘分,顶铁系友情

作者: 晃晃    时间: 2012-12-6 23:22
水……生命之源……灌……

作者: 奇    时间: 2013-2-9 23:34
水……生命之源……灌……

作者: C.R.CAN    时间: 2013-2-9 23:37
好可爱的字,学习了

作者: tc    时间: 2013-3-15 23:23
好`我顶``顶顶





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