- Unity 3.x Game Development by Example Beginner's Guide
- Ryan Henson Creighton
- 135字
- 2021-04-02 18:34:08
Time for action – Adding physics to your game
Let's tap into Unity's built-in physics engine by adding a Rigidbody component to the Ball.
- Select the Ball in the Hierarchy panel.
- In the menu, choose Component | Physics | Rigidbody.
- A Rigidbody component is added to the Ball. You can see it in the list of the components of the Ball Game Object in the Inspector panel.
- Make sure that the Rigidbody component's Use Gravity checkbox is checked in the Inspector panel.
- Click on Play to test your game.
- Click on Play again when you've recovered from how awesome that was.
No way! When you tested your game, you should have seen your Ball plummet straight down and land on the Paddle. How cool was that? If you answered "especially cool", give yourself ten points.
推薦閱讀
- LabVIEW Graphical Programming Cookbook
- Microsoft Dynamics 365 Extensions Cookbook
- OpenCV 3和Qt5計算機視覺應用開發
- 編程珠璣(續)
- Python高級機器學習
- Silverlight魔幻銀燈
- Swift細致入門與最佳實踐
- Apache Spark 2.x for Java Developers
- Visual Basic程序設計實驗指導(第二版)
- PHP 7從零基礎到項目實戰
- Instant Zurb Foundation 4
- Practical GIS
- JavaScript Unit Testing
- Android開發進階實戰:拓展與提升
- Mastering React Test:Driven Development