Version: 2021.3
언어: 한국어
public RaycastHit[] SweepTestAll (Vector3 direction, float maxDistance= Mathf.Infinity, QueryTriggerInteraction queryTriggerInteraction= QueryTriggerInteraction.UseGlobal);

파라미터

direction The direction into which to sweep the rigidbody.
maxDistance The length of the sweep.
queryTriggerInteraction Specifies whether this query should hit Triggers.

반환

RaycastHit[] An array of all colliders hit in the sweep.

설명

Like Rigidbody.SweepTest, but returns all hits.

The sweep may return multiple hits against the same collider if more then one of the rigidbody's attached colliders would hit it.

Note that this function only works when a primitive collider type (sphere, cube or capsule) or a convex mesh is attached to the rigidbody object - concave mesh colliders will not work, although they can be detected in the Scene by the sweep.

This function can only return up to 128 hits.

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