- Unity Artificial Intelligence Programming
- Dr. Davide Aversa Aung Sithu Kyaw Clifford Peters
- 251字
- 2021-06-10 18:57:48
The player's tank
Before writing the script for our player's tank, let's take a look at how we set up the PlayerTank game object. Our Tank object is a simple Mesh with the Rigidbody and Box Collider components. The Tank object is composed of two separate meshes, Tank and Turret, such that Turret is a child of Tank. This structure allows for the independent rotation of the Turret object using the mouse movement and, at the same time, will follow automatically the Tank body wherever it goes. Then, we create an empty game object for our SpawnPoint transform. We use it as a reference position point when shooting a bullet. Finally, for the player's Tank, we need to assign the Player tag to our Tank object. Now let's take a look at the controller class:
The player's Tank is controlled by the PlayerTankController class. We are using the W, A, S, and D keys to move and steer the tank, and the left mouse button to aim and shoot from the Turret object.
- 物聯網與北斗應用
- 網管員典藏書架:網絡管理與運維實戰寶典
- 物聯網識別技術
- 計算機網絡安全實訓教程(第二版)
- 數字通信同步技術的MATLAB與FPGA實現:Altera/Verilog版(第2版)
- 城域網與廣域網(第2版)
- 網絡安全應急響應技術實戰
- 5G技術核心與增強:從R15到R17
- 現場綜合化網絡運營與維護:運營商數字化轉型技術與實踐
- 物聯網傳感器技術與應用
- Building Microservices with Spring
- 互聯網視覺設計(全彩慕課版)
- LiveCode Mobile Development Beginner's Guide
- Twilio Cookbook(Second Edition)
- 5G低功耗蜂窩物聯網開發與應用