Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  When update Mesh Colliders can't update Obi Collider
#4
(24-05-2023, 04:37 PM)jeffLin Wrote:
Code:
var tracker = obiCollider.Tracker;
(tracker as ObiMeshShapeTracker).UpdateMeshData();


執行此後,將報告網格碰撞體為空的錯誤
[附件=1788][附件=1789][附件=1790][附件=1791]

Your collider is using a distance field, but your code expects a MeshCollider. Since you’re trying to cast a distance field tracker to a mesh collider tracker, it fails (with either a failed cast, or a null exception when using the “as” operator).

Remove the “H (Obi Distance Field)” asset from your ObiCollider component, making sure the field shows “None”. This will revert it back to using the MeshCollider.

You can’t use both MeshCollider and a distance field (as it doesn’t make sense), they’re mutually exclusive.
Reply


Messages In This Thread
RE: When update Mesh Colliders can't update Obi Collider - by josemendez - 24-05-2023, 05:49 PM