Docsv3.30.0
Back to API Reference
Class

UniText3DColliders

sealed
Inherits:MonoBehaviour

Keeps physics colliders matching the drawn UniText3D on its object, updated whenever the text's mesh changes, so a rigidbody on the object or around it meets the letters as drawn.

Remarks

The colliders live on a hidden child that is never saved; a rigidbody on the text's object takes them as one compound body. Animated glyphs update the colliders with every change of the mesh: boxes only move, while a mesh collider whose glyphs moved costs collision cooking — convex ones on worker threads under a positive unskewed scale — and mesh colliders keep the text placing its glyphs on the CPU. Shatter gives each piece its own collider about the piece's centre — a box for Boxes, else a convex hull, since pieces move and a non-kinematic body takes no concave mesh; the meshes of those hulls belong to the caller of Shatter. The hidden child takes the object's layer whenever the colliders rebuild: Unity reports no layer change, so a text at rest keeps its colliders on the previous layer until its mesh next changes.
public Text3DColliderShape Shape{ get; set }
public bool IsTrigger{ get; set }
public PhysicMaterial SurfaceMaterial{ get; set }