纳金网

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

作者: 会飞的鱼    时间: 2011-12-8 17:08
标题: 第三人称角色控制教程2(上)
In part 1 of our 3rd person character tutorial we created a basic scene and imported the character into the project, now we will set the input settings and the characters animation cycles.


Input Settings

Our character controller is quite simple; it has a walk and run option, so we need input settings to walk forwards, backwards, turn left, turn right and to switch between running and walking. Of course if you add actions such as jumping and attacks then you will want more input options. So lets configure the input settings for our controller.
Go to "Edit -> Project Settings -> Input".
This will bring up the input settings in the Inspector, pictured below:

You may need to expand the Axis section to reveal the input options, of which there should be 17 different input types. You will see Horizontal and Vertical at the top, these are the left, right, forward and backwards input options. They are named Horizontal and Vertical as they have positive and negative values for the alternate directions and are designed to support keyboard/pad input and analogue input (such as an analogue stick).
Then below that are a number of action inputs, of which we only need 1 (the walk/run toggle). We don't need 17 input options so lets change them:
1. First change the size from 17 to 3, which will get rid of most of the input options
2. We will leave the Horizontal and Vertical options as they are, but you can edit the button assignments if you wish. By default they are up, down, left, right with alternate options W, A, S and D.
3. Select the 3rd option (should be "Fire1"), and extend it to reveal its settings.

- Rename the input to "Run"

- Leave the Positive button as "left ctrl"

- If there is a Negative button, remove the value so its blank

- Remove the alternative Positive and Negative options so they are blank; fire defaults to Mouse 0 which can interfere with the controls.
Your controls should now look like the ones pictured below:

Coming back to the Horizontal and Vertical axes for a moment; Horizontal refers to your left and right controls and Vertical refers to your forward and backward controls (or up and down depending on your implementation).
You always have a positive and negative assignment and an alternative positive and negative assignment, these alternatives allow you to have alternative buttons attached to the control, however you should be careful that they do not conflict or interfere with eachother.



由 u8  发表
作者: osaka    时间: 2011-12-9 09:11
犀利啊
作者: 菜刀吻电线    时间: 2012-4-27 23:26
我看看就走,你们聊!

作者: 奇    时间: 2012-5-9 23:27
心中有爱,爱咋咋地

作者: 奇    时间: 2012-5-12 23:26
不错啊 经典

作者: 晃晃    时间: 2012-8-2 23:22
心中有爱,爱咋咋地

作者: 晃晃    时间: 2012-10-22 23:37
顶!学习了!阅!

作者: 晃晃    时间: 2013-1-29 23:20
俺是新人,这厢有礼了!

作者: 菜刀吻电线    时间: 2013-2-14 23:27
都闪开,介个帖子,偶来顶

作者: C.R.CAN    时间: 2013-2-20 23:27
很经典,很实用,学习了!

作者: tc    时间: 2013-3-15 23:32
先顶上去,偶要高亮加精鸟!





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