Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

PhysicsSpace.CreateProxyShapes

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

Declaration

public NativeArray<ProxyHandle> CreateProxyShapes(ReadOnlySpan<PhysicsShape> shapes, Allocator allocator);

Parameters

Parameter Description
shapes The shapes to create proxies for.
allocator The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.

Returns

NativeArray<ProxyHandle> The created proxy handles, one per shape in the same order. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty.

Description

Create one proxy per shape, taking each proxy AABB, categories and user handle directly from the shape. This only applies to a space bound to a world, and every shape must be a live shape in that world.

See PhysicsSpace.Create and PhysicsSpace.sourceWorld. If any shape is invalid or not in the bound world then no proxies are created and an empty array is produced.