Legacy Documentation: Version 5.5
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

PlatformEffector2D.useOneWayGrouping

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public var useOneWayGrouping: bool;
public bool useOneWayGrouping;

Description

Ensures that all contacts controlled by the one-way behaviour act the same.

When using the oneWay behaviour, each individual collider that comes into contact with the PlatformEffector2D is checked to see if it should be disabled or not by comparing its collision normal to the surfaceArc. Working on each individual collider like this can cause problems on objects that are comprised of multiple colliders.

If an object is comprised of many colliders and one of them has a contact disabled due to the one-way behaviour then it may be preferable to do the same for all colliders on the same object should they come into contact with the same PlatformEffector2D. To do this, set the useOneWayGrouping to true. When you do this, all colliders essentially act as one, all following each other with regards to the one-way behaviour.

When the useOneWayGrouping is not enabled, an object comprised of multiple colliders could end up in a situation where it has one collider contact disabled by passing through the one-way platform, but have others not able to pass through.

See Also: useOneWay.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961