Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[RELEASED] MagicaCloth2 - Hybrid Cloth Simulation

Discussion in 'Assets and Asset Store' started by hoshos, Feb 5, 2023.

  1. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    We do not yet have a weight function.
    However, we understand the importance of this feature.
    It has already been implemented in Ver1 as a "Blend Weight" parameter.
    Therefore, we will definitely implement it in Ver2 in the near future.
    Until then, please wait a little longer.
     
    Creiz likes this.
  2. Agoxandr

    Agoxandr

    Joined:
    Aug 16, 2014
    Posts:
    45
    I often get an error after I enter play mode on subsequent runs.
    Not sure how well I could reproduce this.
    I'm using Unity 2021.3.20, Ubuntu
    Enter play mode settings are unchanged so full domain reload.
    Code (CSharp):
    1. errorId: Assert failed
    2. This Exception was thrown from a job compiled with Burst, which has limited exception support.
    3. #3 Unity.Jobs.IJobParallelForExtensions.ParallelForJobStruct`1<MagicaCloth2.VirtualMeshManager.CalcTriangleNormalTangentJob>.Execute(ref MagicaCloth2.VirtualMeshManager.CalcTriangleNormalTangentJob jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) -> void_fca57f8440a054cc95b1a23e940de8c4 from UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
    4. #4 1382d634b5f74bfc97ebcd70d86afe7d
    5. #5 ExecuteJob(ManagedJobData*, void (*)(void*, void*, void*, void*, int), int, unsigned char*)
    6. #6 ExecuteJobCopyData(ManagedJobData*, void (*)(void*, void*, void*, void*, int), int)
    7. #7 ForwardJobForEachToManaged(ManagedJobData*, unsigned int)
    8. #8 JobQueue::Exec(JobInfo*, long long, int, bool)
    9. #9 JobQueue::ExecuteJobFromHighPriorityStack(bool, bool&)
    10. #10 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*)
    11. #11 JobQueue::WorkLoop(void*)
    12. #12 Thread::RunThreadWrapper(void*)
    13. #13 pthread_condattr_setpshared
    14. #14 __xmknodat
    15.  
     
    Last edited: Mar 13, 2023
  3. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    Thank you for reporting the problem.
    We were able to locate the problem from the error log.
    It is occurring in the algorithm that finds the normal and tangent of the triangle from the proxy mesh of the simulation results.

    However, I still do not know how this error occurs.
    So please tell me the following

    (1)
    What version of MagicaCloth2 do you have?
    You can check the version by
    https://magicasoft.jp/en/mc2_install/#How_to_check_the_version

    (2)
    Is the MagicaCloth component causing the problem the same?
    In other words, can you confirm if one particular MagicaCloth component is causing the problem?
    If you can tell, is the cloth type of that component BoneCloth or MeshCloth?

    (3)
    Is the timing of the occurrence random?
    Or does it occur at a certain time after the start of play?
     
  4. fengkan

    fengkan

    Joined:
    Jul 10, 2018
    Posts:
    82
    Is there a counterpart component of MagicaAvatar in 2?
     
  5. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    MagicaAvatar was discontinued in Ver2.
    The reason was that it was not flexible enough for many users.
    We apologize for the inconvenience, but Ver2 only supports the scripted method of changing clothes.
    https://magicasoft.jp/en/mc2_dressup/

    This is a bit cumbersome, but it is more flexible.
    Also, it is much easier to set up than Ver1.
     
    fengkan likes this.
  6. fengkan

    fengkan

    Joined:
    Jul 10, 2018
    Posts:
    82
    Thank you for your reply, it's great to know that. I should have read the doc thoroughly.
     
  7. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Update: 2.0.5

    v2.0.5 has been released on the Asset Store!
    https://u3d.as/2Zc3

    Release Note:
    Fix: Initialization fails when vertices have only invalid attributes.
    Fix: Information in inspector was not updated correctly when RendererList or PaintMapList was changed.
    Fix: PaintMap allocation fails when UV value of mesh is not (0.0~1.0).

    https://magicasoft.jp/en/mc2_releasenote/

    How to Update

    Please follow the following steps to update the software as much as possible.
    (1)Backup your project
    (2)Delete the MagicaCloth2 folder from the Unity editor
    (3)Import the latest MagicaCloth2 from PackageManager
     
  8. fengkan

    fengkan

    Joined:
    Jul 10, 2018
    Posts:
    82
    Hi, I have tried RuntimeDressUpDemo, and it works great, thank you!

    In RuntimeDressUpDemo, there is some code to move all colliders from the cloth to the new avatar, so I am wondering how to copy colliders from avatar to cloth? Something like the Merge Avatar Collider setting in Ver1. Thank you.
     
  9. alexmalyutindev

    alexmalyutindev

    Joined:
    Feb 4, 2017
    Posts:
    2
    Hello! I'm run into bug, when trying to do my custom dress up system.
    I've made a small repro for you (needed to import Magica Cloth 2.0.5): https://github.com/alexmalyutindev/magica-cloth-bug-repro
    The bug appears when i'm disabling some of dress part and instantiate new one. It causes some conflicts inside simulation and transforms don't updates properly (see video in repo).
     
  10. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    Of course it is possible.
    If you want to copy a collider, just Instantiate() it normally.
    It is also easy to add/remove colliders to/from the MagicaCloth component.
    Please refer to the following documentation on how to do this
    https://magicasoft.jp/en/mc2_runtimechanges/
     
  11. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    Thank you for your project.
    I was able to reproduce the same situation here.
    I'm going to investigate, so please give me some time.
     
    Si1ver and alexmalyutindev like this.
  12. Frostinemolv

    Frostinemolv

    Joined:
    Jan 5, 2023
    Posts:
    5
    Hello,
    I built a dress up system with magica cloth 1 previously. I want to upgrade the system by using magica cloth 2.
    My dress up system contains skirts with different length and style. This means they have different skirt bones and same humanoid bones. When I look into the exampleof dress up system in magica cloth 2, I saw the Utc_sum_humanoid (Hair) contins the skirt bones . The hair, skirt and emppty skeleton all had the same skeleton. Is it necessary for all the parts to have same skeleton?

    Can I have a basic humanoid skeleton and equip different parts with different additional bones(eg. hair part with humanoid bones and additional hair bones) to it as shown in the 11.png WE4NFF($`OLPEJCK70}TVSI(1).png graph?
     
  13. Agoxandr

    Agoxandr

    Joined:
    Aug 16, 2014
    Posts:
    45
    2.0.4
    1 Mesh cloth on a prefab that is created after the player presses a button.
    Fixes itself randomly after many times of entering Playmode.

    When this error happens the game becomes unplayable (error every frame).
     
  14. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Update: 2.0.6

    v2.0.6 has been released on the Asset Store!
    https://u3d.as/2Zc3

    Release Note:
    Fix: Fixed an issue where disabling a MagicaCloth component would not stop writing to the associated Transform.
    Fix: Fixed the problem that the coordinates of the paint map were shifted when using the paint map with MeshCloth and the Transform pose of the target renderer was not the unit pose.

    https://magicasoft.jp/en/mc2_releasenote/

    How to Update

    Please follow the following steps to update the software as much as possible.
    (1)Backup your project
    (2)Delete the MagicaCloth2 folder from the Unity editor
    (3)Import the latest MagicaCloth2 from PackageManager
     
    alexmalyutindev likes this.
  15. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    Don't worry, you don't have to put all bones into your skeleton avatar.
    In UnityChan's sample scene example, Utc_sum_humanoid (Skeleton) does not need skirt and hair bones.
    In this case, the required Transform hierarchy present in the Outfit prefab must be manually ported to the Skeleton Avatar.
    This code is a bit complicated and is not included in the sample code.
    This matter is also described in the Kisekae document.
    https://magicasoft.jp/en/mc2_dressup/#Notes

    Therefore, porting this Transform should be done manually by yourself.
    However, I think it would be more convenient to have this porting sample, so I will consider whether to include it in the sample code.
     
    Frostinemolv likes this.
  16. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    v2.0.6 was just released.
    Some bugs have been fixed since v2.0.4.

    Therefore, I am sorry to trouble you, but could you please update to v2.0.6 first and test if an error occurs?
    Be sure to do a clean install when updating.
    (1) Backup your project
    (2) Delete the MagicaCloth2 folder from the Unity editor
    (3)Import the latest MagicaCloth2 from PackageManager
     
  17. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    200
    Hi, does this asset support curves? I am looking into using HDRP hair shader(not the strand hair package) to render hair. But instead of simulating hair strands, I wonder if we can use magica cloth to rig/move hair.
     
  18. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    263
    We're facing problem where the hair physics isn't the same on 2nd enter play mode onward after a domain reload.

    We have disable domain reload on enter playmode.
     
  19. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    I think it's possible.
    MagicaCloth can be used with hair cards and hair meshes.
    Also, if bones are incorporated in the hair, you can use BoneCloth to shake the bones.

    For example, the first character in the following video uses BoneCloth to sway the bones embedded in the hair.
    Also, the character from 1:15 uses MeshCloth to sway the mesh of the hair itself.
     
    merpheus likes this.
  20. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    Thank you for the video.
    It certainly looks like the second move is different.

    (1)
    First of all, is MagicaCloth the latest?
    Currently the latest is v2.0.6.
    If it is old, try updating to v2.0.6 first.
    Make sure to do a clean install when updating.
    https://magicasoft.jp/en/mc2_install/#How_to_Update

    (2)
    Also, is it only the hair that occurs?
    It looks like MagicaCloth is also used for the skirt, but is the skirt okay?

    (3)
    Does enabling domain reload change the results?
    In other words, does turning off the Enter Play Mode Options fix it?
     
  21. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    263
    Upgrading to 2.0.6 fixed the issue. Thanks.
     
  22. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    I'm relieved that the problem is solved!
     
    jiraphatK likes this.
  23. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    263
    upload_2023-3-21_11-20-18.png
    Hi, I want to ask another question regarding the collider list. Should I be aware of any performance implication of the collider here? I want to set up full body collider but not sure if it's sane to do that.
     
  24. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Up to 32 colliders can be set for one MagicaCloth component.
    Please be aware of this limitation.
    Also, if the capsule side collider can be used, it is more advantageous in terms of speed than connecting many sphere colliders.
    It may be a little difficult to set a collider that is close to the human body, but please do your best.
     
    jiraphatK likes this.
  25. gekidoslair

    gekidoslair

    Joined:
    Sep 7, 2012
    Posts:
    120
    Hi there,

    I'm having an issue creating skirts for my characters - I have painted the weights for the mesh as shown below, but when I enter playmode, the top section of the skirt (the 'invalid' and 'fixed' verts) are literally fixed in place, they do not deform according to the skinning of the mesh?

    Note: the same thing happens whether the top verts are marked as invalid or fixed?

    Feels like I'm missing something obvious

    skirtissue.png

    Here's a video showing the issue:

    (fixed video permissions)

    As you can see the top of the skirt is doesn't deform with the rest of the character mesh for some reason?
     
    Last edited: Mar 22, 2023
  26. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    I saw the video.
    Invalid vertices are not affected by the simulation and behave the same as without MagicaCloth.
    Therefore, the movement of this video is different from the specification.
    I have a question.
    Is this skirt properly skinned to the character's bones?
    In other words, does the skirt follow the character's waist correctly when you run it with the MagicaCloth component deleted?
     
  27. Faisal_Azizi_

    Faisal_Azizi_

    Joined:
    Feb 5, 2021
    Posts:
    25
    Hello!
    Is there a way for me to modify the selection points manually using code? what i am trying to do is have some kind of a lod system where if i create select the points using the manual method i want points that are near the LOD0 be carried over to the second lod. i need a way to manually go through the points and select them.

    picking up the question from the pm.

    I was wondering if this feature was present in the first version of magica cloth?
     
  28. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Thank you for reposting on this forum.
    I will answer the question.

    Unfortunately, it is not possible to finely set vertex attributes from the outside.
    Using paint maps is the only way to specify vertex attributes at runtime.
    https://magicasoft.jp/en/mc2_vertexpaint/#Vertex_painting_with_textures

    You can also construct MeshCloth at runtime by using paint maps.
    https://magicasoft.jp/en/mc2_runtime_build/#MeshCloth_construction_example_1

    However, both must be set during initialization before the simulation starts.
    Vertex attributes cannot be changed once the simulation has started.

    Also, this problem is the same in Ver1.
     
  29. gekidoslair

    gekidoslair

    Joined:
    Sep 7, 2012
    Posts:
    120
    Is this skirt properly skinned to the character's bones?
    In other words, does the skirt follow the character's waist correctly when you run it with the MagicaCloth component deleted?

    Yes it's skinned properly.

    Here's a video showing the magica component disabled versus enabled - everything else in the workflow is identical:



    What I AM doing however is dynamically spawning the skirt prefab and attaching it to the character at runtime, which does require a few steps before the cloth is enabled, perhaps I'm missing a step on the magica side.

    Basically the workflow is:
    1) Spawn clothing prefab
    2) update the bones in the clothing skinnedmesh to use the same bones that the main character uses
    3) update the colliders in the magica mesh with the magica colliders on the main character
    4) enable custom skinning on the magic mesh & update the clothdata.customSkinningSetting bones with the proper bones
    5) call 'cloth.BuildAndRun()'

    I suspect I'm missing something in step 4 or 5 that isn't fully initializing the magica system with the new bones that the skinned mesh is using?

    How I'm doing this is like this:

    Code (CSharp):
    1. public void SetClothColliders(List<MagicaCapsuleCollider> colliders)
    2.         {
    3.             clothColliders = colliders;
    4.  
    5.             var clothData = cloth.SerializeData;
    6.             clothData.colliderCollisionConstraint.colliderList.Clear();
    7.             clothData.colliderCollisionConstraint.colliderList.AddRange(clothColliders);
    8.          
    9.             // and update the bones for the mesh since the clothing spawner replaced them with the main character's bones
    10.             clothData.customSkinningSetting.enable = true;
    11.             clothData.customSkinningSetting.skinningBones = skinnedMesh.bones.ToList();
    12.          
    13.             // tell the cloth system that we changed
    14.             cloth.BuildAndRun();
    15.         }
    Is there anything else required to update the mesh cloth bones at runtime?
     
    Last edited: Mar 22, 2023
  30. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Thank you for the detailed video.
    I think this is probably a problem with the dress-up process for the skirt.

    When adding such a dress-up prefab to a character, it is necessary to replace the Transform inside MagicaCloth with the Transform of the new character, just like the SkinnedMeshRenderer.
    This workflow looks like this:

    (1) Create a clothes prefab. MagicaCloth is also set here.
    (2) Instantiate the clothes prefab during the game.
    (3) Replace the skinnedmesh bones of the clothes with those of the new character
    (4) Replace the bones of MagicaCloth with those of the new character
    (5) Porting colliders. Or add a collider to MagicaCloth.
    (6) Call cloth.BuildAndRun().

    This procedure is detailed in the following documents:
    Please follow this method and test it.
    https://magicasoft.jp/en/mc2_dressup/
     
  31. Agoxandr

    Agoxandr

    Joined:
    Aug 16, 2014
    Posts:
    45
    I tried out 2.0.6. Same issue. However, I figured out what is causing it. It only appears when a MeshCloth has more than 1 SourceRenderer.

    Edit:
    I just found a fix. Setting the NormalAlignment from None to Bounding Box Center fixes the issue even with multiple SourceRenderers. My skirt has multiple parts where some verts have the exact same position.
     
    Last edited: Mar 23, 2023
  32. gekidoslair

    gekidoslair

    Joined:
    Sep 7, 2012
    Posts:
    120
    Thanks for the link to the 'dress up process' - I had read that originally but re-reading it now, I definitely missed a couple of steps. Let me poke at it some more and let you know!

    Thank you for the quick responses!
     
    hoshos likes this.
  33. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    First of all, I was relieved that the problem was solved.
    However, this problem is likely to reoccur.
    I've just tested with different meshes and was unable to reproduce the problem.
    So, if possible, can I borrow the FBX file that causes the problem?
    I sent you a DM, so please respond if possible.
     
  34. zrrz

    zrrz

    Joined:
    Nov 14, 2012
    Posts:
    40
    Hello I'm getting lots of errors like:
    Code (CSharp):
    1. Assets\MagicaCloth2\Scripts\Core\Reduction\ReductionWorkData.cs(26,16): error CS0246: The type or namespace name 'NativeMultiHashMap<,>' could not be found (are you missing a using directive or an assembly reference?)
    Magica Cloth 2 2.0.6
    Burst 1.8.3
    Collections 2.1.0-pre.18

    I can't roll back to Collections 1.4.0 because Unity Transport has a dependency of Collections 2.1.0-pre.6

    It looks like between Collections 2.0.0 and 2.1.0 they renamed NativeMultiHashMap to NativeParallelMultiHashMap

    I was able to get everything working by changed things under MC2_COLLECTIONS_200 to NativeParallelMultiHashMap
     
  35. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    Thank you for your report.
    Please be patient as we will address this issue as soon as possible.
     
  36. Faisal_Azizi_

    Faisal_Azizi_

    Joined:
    Feb 5, 2021
    Posts:
    25
    Hello! Does magica cloth 2 support wind?
     
  37. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    No, there is no wind system in Ver2 yet.
    But rest assured that it will definitely be added.
    If all goes well, it will be implemented next month.
     
  38. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Update: 2.0.7

    v2.0.7 has been released on the Asset Store!
    https://u3d.as/2Zc3

    Introduced stabilization time during initialization or reset.
    A problem that occurred when the cloth and the collider overlapped at the start of simulation, causing the vertices to be pushed out at once and the cloth to deform significantly, has been greatly improved.
    mc2_StablizationTime.gif

    The Fill button and Through function have been added to Vertex Paint.
    The Through function allows you to paint points within the cursor, ignoring depth.
    mc2-vertexpaint-1.jpg

    The latest Collections2.x package is now supported.
    If you use 2.x, you need to install 2.1.0-pre.11 or higher.

    Release Note:
    Added: Added Fill button to vertex paint. It is possible to fill all points at once.
    Added: Added Through function to vertex paint. This feature allows you to fill points in the cursor range regardless of depth.
    Added: Added an API (GetCenterPosition) to get the center position of the cloth. This is the position of the purple gizmosphere, which is the center of inertia coordinate.
    Added: Added a property (blendWeight) to the ClothSerializeData class that sets the blend ratio of the cloth's original posture and simulation posture.
    This property is an internal variable only and should be accessed from the script.
    Improvement: The issue of vertices being pushed violently at the start of the simulation when cloth and colliders overlap during initialization and reset has been greatly improved.
    This is adjustable from the inspector as the StablizationTime property.
    Improvement: Supported the latest version of Collections2.x package. Please install 2.1.0-pre.11 or higher when using Collections2.x.

    https://magicasoft.jp/en/mc2_releasenote/

    How to Update

    Please follow the following steps to update the software as much as possible.
    (1)Backup your project
    (2)Delete the MagicaCloth2 folder from the Unity editor
    (3)Import the latest MagicaCloth2 from PackageManager
     
  39. Faisal_Azizi_

    Faisal_Azizi_

    Joined:
    Feb 5, 2021
    Posts:
    25
    T
    Thanks looking forward to it !
     
  40. Clariesu

    Clariesu

    Joined:
    Apr 2, 2021
    Posts:
    24
    Can Bone Cloth take effect simultaneously with Mesh Cloth? I am using Mesh Cloth for my character's dress, which is not as smooth and natural as Bone Cloth. I am attempting to add fabric effects based on using Bone Cloth, and I am not sure if this idea is correct
     
  41. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    It is difficult to give accurate advice since I have not seen the actual movement, but for dresses and skirts, MeshCloth is more suitable than BoneCloth.
    MeshCloth is also more resistant to collision detection.
    If you use MeshCloth, it is better to simplify the ProxyMesh to some extent for better movement.
    Please refer again to the following guide
    https://magicasoft.jp/en/mc2_meshclothstartguide/

    When implementing a skirt with BoneCloth, it is important to connect it horizontally as well as vertically.
    Otherwise you will be quite vulnerable to collision detection.
    https://magicasoft.jp/en/mc2_bonecloth_mesh/

    However, if you connect the BoneCloth horizontally, the movement may become stiff.
    If this is the case, try lowering [Distance Stiffness] or [Triangle Bending].
    https://magicasoft.jp/en/mc2_magicacloth_shaperestoration/
     
  42. gekidoslair

    gekidoslair

    Joined:
    Sep 7, 2012
    Posts:
    120
    Having a ton of fun with Magica - here's a test with some long hair!

     
  43. tenos

    tenos

    Joined:
    Jul 3, 2014
    Posts:
    2
    Do you have any plans to consider using xpbd ?
    xpbd:https://matthias-research.github.io/pages/publications/XPBD.pdf
     
  44. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    It's wonderful!
    I'm glad you can use it this way.
     
  45. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    We have experimented with XPBD but have not implemented it.
    MagicaCloth is structured in such a way that XPBD cannot be easily implemented because of various modifications to the regular PBD.
    However, we will continue our research and may implement it in the future.
     
  46. Faisal_Azizi_

    Faisal_Azizi_

    Joined:
    Feb 5, 2021
    Posts:
    25
    Hi, can i request you to add a way to modify the clothSelection manually using code?
     
  47. CarmenXero96

    CarmenXero96

    Joined:
    Mar 25, 2013
    Posts:
    17
    Is there a way to have bone/mesh cloth collide with objects in the world? I have long strands of hair I wish to have collide with the floor. I can use the collision system to make it collide with the player's body and such, but I'm unsure if its possible to have it not go through the floor.
     
  48. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    It is possible, but could you please tell us why we need this feature?
    In other words, under what circumstances would you use it?
     
    Faisal_Azizi_ likes this.
  49. hoshos

    hoshos

    Joined:
    Mar 7, 2015
    Posts:
    820
    Hello.
    MagicaCloth's collision detection only reacts to objects registered in the component's ColliderList.
    Therefore, it is difficult to make it come into contact with objects in world space.
    However, there are two solutions.

    (1) Use of Plane Collider
    If you simply want to make a collision detection like a floor under your feet, you can use Plane Collider.
    https://magicasoft.jp/en/mc2_planecollidercomponent/
    Place this at the feet of the character in advance.

    (2) Use of scripts
    Another method is to replace the collider in ColliderList at runtime.
    This requires writing a script.
    For details, please refer to the following sample.
    https://magicasoft.jp/en/mc2_runtimechanges/
    Although a bit tedious, this method makes it possible to swap the collider according to the occasion.

    Note that the maximum number of colliders that can be registered in one component is 32.
     
  50. gekidoslair

    gekidoslair

    Joined:
    Sep 7, 2012
    Posts:
    120
    got it all sorted! dynamically spawning / configuring the magica cloth objects, hooking up the hair etc - the hair objects are dynamically spawned for the characters (as is the clothing etc)

    Thanks for your help!