要产生令人信服的物理行为,游戏中的对象必须正确加速并受到碰撞、重力和其他作用力的影响。Unity 的内置物理引擎提供了处理物理模拟的组件。只需几个参数设置,就可以创建逼真的被动对象(即,对象将因碰撞和跌落而移动,但不会自动开始移动)。通过使用脚本控制物理特性,即可为对象提供一辆车、一台机器甚至一块布产生的动力学效应。本部分将概述 Unity 中的主要物理组件,并提供进一步阅读的链接。
注意:__Unity 中实际上有两个独立的物理引擎:一个用于 3D 物理系统,一个用于 2D 物理系统。两个引擎的主要概念是相同的(除了 3D 中多了一个维度),但它们是使用不同的组件实现的。例如,3D 物理有__刚体__组件,而 2D 物理则有类似的 2D 刚体__。
相关教程:物理系统 (Physics);物理系统最佳实践 (Physics Best Practices)
请参阅知识库的物理系统 (Physics) 部分了解故障排除方法、提示和技巧。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.