纳金网

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

作者: 会飞的鱼    时间: 2011-12-7 15:24
标题: 第三人称角色控制教程1
很不错的一篇英文教程,还算易读。主要讲解如何制作一个第三人称角色控制功能,比较常用也比较实用的一个功能。
In this tutorial for the Unity game engine we will be learning how to create a 3rd person character controller. For new Unity developers, the question of how to create a working 3rd person controller is possibly one of the most asked questions out there.
While there are a number of guides out there many new developers feel that they are difficult to understand, difficult to follow and awkward to use in practice, this is because they are either tied into a full game case study and therefore contain a lot of game specific code, are over complicated and aren't designed to be taken as a controller framework.
So we've attempted to fill that void by creating this 3rd person controller tutorial which will take you through the steps required to implement a functional 3rd person controller which is complete enough to be useful but simple enough to be easy to follow and extended to meet your games requirements.
The bottom line is, 3rd person controllers are actually very simple to implement but are made difficult due to the lack of documentation with a reasonable point of entry.



Before we Begin

Before we begin this tutorial you will need a character with at least three animation cycles, don't worry if you don't have one as we've supplied one below. If you want to use your own then you'll need three animation cycles:
1. An idle cycle (so standing still)

2. A walk cycle

3. A***n cycle
If you have a character and want to use it then make sure you have at least those three animations. Also if your using a Biped Rig created in 3D Studio Max then make sure the Pelvis is named "rootJoint" as Unity looks for that joint as the root.
相关开始项目文件会在U吧资源频道提供,当然,你也可以自己准备初始素材文件!
Create the Project and Scene

Once you have a character, either our test character or your own, then we're ready to go. Naturally before we***n off and create a controllable character we'll need to setup some kind of a game level for the character to walk around. So follow these steps:
1. Create a new project by going to "File -> New Project". You don't need any of the asset packages for this tutorial but we're including the standard asset package anyway so we can grab the sky box and some terrain textures.
2. When the blank project is loaded up we will want to create our scene which will contain a textured terrain, a sky box and a directional light, so:

- First create a terrain by going to "Terrain -> Create Terrain".

- Second create a directional light by going to "GameObject -> Create Other -> Directional Light", then move it upwards and rotate it down so its shining down onto the terrain.

- Now select the Terrain in the Hierarchy then select Paint Terrain Texture button in the Inspector and add a default texture

- Finally go to "Edit -> Render Settings", then in the Inspector set the Skybox Material to one of the sky boxes (i.e. blue sky or sunset)
You should then have a very basic level like the one pictured below.



Importing the Character

Now we need to import our character into the project, so in the Project Panel, right click and select "Import New Asset". When the dialogue appears, find your character and import it.
Depending on the character it may take a short while to import, but when its in you should see the characters prefab in the Project panel.
If you are using your own character which has textures then you will want to import the textures and assign them to the model as well. Details on how to do this are contained in the Character Setup tutorial linked in the introduction above.
So lets continue, in part 2 we will setup the animation cycles and input settings.
由 u8  发表
作者: 奇    时间: 2012-2-3 23:20
你们都躲开,我来顶

作者: 晃晃    时间: 2012-3-25 23:25
再看一看,再顶楼主

作者: 晃晃    时间: 2012-5-8 23:25
此地無銀。。。

作者: C.R.CAN    时间: 2012-9-24 23:21
先垫一块,再说鸟

作者: 晃晃    时间: 2012-10-15 23:24
不会吧,太恐怖了

作者: tc    时间: 2012-10-29 23:24
读铁系缘分,顶铁系友情

作者: C.R.CAN    时间: 2013-3-13 23:19
路过、路过、快到鸟,列位请继续...ing

作者: dzspb    时间: 2013-7-31 10:27
还不错,谢谢!
作者: shengbin88    时间: 2013-8-15 00:04
看看了谢谢
作者: 幸福小猪    时间: 2013-10-25 11:53
感谢楼主分享~
作者: star-小虎    时间: 2013-10-25 15:08

还不错,谢谢!




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