Help When update Mesh Colliders can't update Obi Collider - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Help When update Mesh Colliders can't update Obi Collider (/thread-3885.html) |
When update Mesh Colliders can't update Obi Collider - jeffLin - 24-05-2023 Hi, I refer to this thread to make meshCollider update, but ObiCollider does not refresh Know that meshCollider is expensive so useful use distance fields I would like to ask how to update the MeshCollider of ObiCollider? Because I am developing an adult game, I can't post a screenshot here [Offline Rendering] update Mesh Colliders (virtualmethodstudio.com) RE: When update Mesh Colliders can't update Obi Collider - josemendez - 24-05-2023 (24-05-2023, 12:50 PM)jeffLin Wrote: Hi, Hi there, You must call: Code: ((ObiMeshShapeTracker)obiCollider.Tracker).UpdateMeshData(); kind regards, RE: When update Mesh Colliders can't update Obi Collider - jeffLin - 24-05-2023 (24-05-2023, 02:46 PM)約瑟門德斯 Wrote: 你好,你必須打電話: Code: var tracker = obiCollider.Tracker; 執行此後,將報告網格碰撞體為空的錯誤 [附件=1788][附件=1789][附件=1790][附件=1791] RE: When update Mesh Colliders can't update Obi Collider - josemendez - 24-05-2023 (24-05-2023, 04:37 PM)jeffLin Wrote: 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. |