官术网_书友最值得收藏!

Setting up a testbed

Now, before we get started, let's create an area that we can use to test our new weapons.

  1. Open up the project and a scene for us to work with. We can create a new level but, in this instance, UFPS comes with a nice scene for us to start with. From the Project tab, go to the UFPS/Base/Content/Levels/CleanScene folder and double-click on the CleanScene file.

    This scene (or level) is a simple terrain with a basic first-person camera and controller intended for prototyping, which is perfect for us, except we want our player to be already set up. To do this, we will remove this simple camera and replace it with a built-in one.

  2. From the Hierarchy tab, select the Camera object by clicking on it and delete it by pressing the Delete key.
  3. Next, go to the UFPS/Base/Content/Prefabs/Players folder and drag and drop an AdvancedPlayer prefab into your game world. To see the object, double-click on it in Hierarchy (or press the F hotkey with it selected) and it'll zoom directly to its position.
  4. You may notice that there are quite a few things attached to this player, but the most important thing to notice right now is the light green capsule shape, or half capsule shape, depending on how it's positioned. Move this object up on the Y axis until the entire capsule is above the ground plane by grabbing on to the green arrow and dragging it upward. (If you do not see the arrows, press the W hotkey to select the Translation tool. Alternatively, you can set the Transform component's Position Y property to -7 using Inspector.)
    Setting up a testbed

    Note

    This capsule is where the player will collide with the world, so it's important that we're up, on the top of the ground or else we may fall through the ground into the void below!

  5. Now, click on the Play button. You should note that we can now control a player.
    Setting up a testbed

If you press keys from 1 to 4, you should be able to shoot using various weapons.

Here are the various other controls you can use:

主站蜘蛛池模板: 阿合奇县| 铜川市| 本溪| 贵定县| 四子王旗| 阿拉善左旗| 修水县| 大安市| 那坡县| 建平县| 双柏县| 开鲁县| 伊春市| 和顺县| 南漳县| 岚皋县| 庆云县| 安乡县| 淮阳县| 卫辉市| 荔波县| 东源县| 临城县| 青铜峡市| 台南县| 中西区| 林芝县| 武山县| 莱芜市| 磴口县| 开江县| 政和县| 莫力| 行唐县| 德昌县| 长葛市| 丹寨县| 廊坊市| 呈贡县| 东乌| 砚山县|