- 最后登录
- 2014-10-23
- 注册时间
- 2011-7-19
- 阅读权限
- 90
- 积分
- 81303
- 纳金币
- -1
- 精华
- 11
|
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 发表 |
|