Version: 2023.1
public Vector2 surfaceAnchor ;

描述

The direction and distance to use when detecting if a surface is nearby during a slide iteration.

During a Rigiodbody2D.Slide this vector is used to detect if a surface is nearby and will cause the slide to be anchored in that direction to the surface.

The default is Vector2.down which is a typical direction and distance used in platformers however this can be reduced in distance so that the surface anchoring is more subtle. If the surface anchor is Vector2.zero then surface anchoring will be disabled.

See Also: Rigidbody2D.Slide and SlideResults.

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