二维区域效应器在附加的碰撞体用于处理对象物理碰撞的不可见形状。碰撞体不需要与对象的网格完全相同形状 - 粗略的近似值通常更有效,并且在游戏玩法中无法区分。 更多信息
参见 术语表 2D 定义的区域内应用力,当另一个(目标)碰撞体 2D 与效应器 2D 接触时。您可以以特定大小和该大小的随机变化,以任意角度配置力。您还可以应用线性力和角阻力来减缓刚体允许游戏对象受模拟重力和其它力的影响的组件。 更多信息
参见 术语表 2D 的速度。
与二维区域效应器一起使用的碰撞体 2D 通常会被设置为触发器,以便其他碰撞体 2D 可以与其重叠以应用力。非触发器仍然可以工作,但只有当碰撞体 2D 与其接触时才会应用力。
属性 | 功能 |
---|---|
使用碰撞体遮罩 | 选中以启用碰撞体遮罩属性的使用?如果未启用,则全局碰撞当物理引擎检测到两个游戏对象的碰撞体接触或重叠时,就会发生碰撞,前提是至少有一个具有刚体组件并且处于运动状态。 更多信息 参见 术语表矩阵将用作所有碰撞体 2D 的默认值。 |
碰撞体遮罩 | 用于选择允许与二维区域效应器交互的特定图层的遮罩。 |
使用全局角度 | 选中此项以将力角度定义为全局(世界空间)角度。如果未选中此项,则力角度被物理引擎模拟物理系统各个方面的系统,以便对象能够正确加速并受碰撞、重力和其它力的影响。 更多信息 参见 术语表视为局部角度。 |
力角度 | 要应用的力的角度。 |
力大小 | 要应用的力的大小。 |
力变化 | 要应用的力大小的变化。 |
阻力 | 要应用于刚体 2D 的线性阻力。 |
角阻力 | 要应用于刚体 2D 的角阻力。 |
力目标 | 二维区域效应器应用任何力的目标游戏对象Unity 场景中的基本对象,可以表示角色、道具、场景、摄像机、路径点等等。游戏对象的功用由附加在其上的组件定义。 更多信息 参见 术语表上的点。 |
&#nbsp;&#nbsp;&#nbsp;&#nbsp;碰撞体 | 目标点定义为碰撞体 2D 的当前位置。如果碰撞体 2D 未位于质心代表刚体中所有质量的平均位置,用于物理计算。默认情况下,它是根据属于刚体的所有碰撞体计算的,但可以通过脚本进行修改。 更多信息 参见 术语表,则在此处应用力会产生扭矩(旋转)。 |
&#nbsp;&#nbsp;&#nbsp;&#nbsp;刚体 | 目标点定义为刚体 2D 的当前质心。在此处应用力永远不会产生扭矩(旋转)。 |
AreaEffector2D
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.