Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Dynamic Mesh Cutter - A flexible run time mesh cutting solution [Discussion Thread]

Discussion in 'Assets and Asset Store' started by PBTools, Mar 7, 2022.

  1. it_max_2017

    it_max_2017

    Joined:
    Mar 8, 2018
    Posts:
    2
    hello! thank you so much for your asset. I have a question, I would really appreciate it if you could help with it. for example, when I have 2 ragdoll objects on the scene, I draw a line along one of them, but they both cut, as if the line is extended and falls on the second object. is it possible to somehow modify the cut method so that by swiping at one object, the slicer cuts only the object on which the line was drawn, and not all those that fell under the continuation of the line? Thanks a lot in advance!
     
  2. it_max_2017

    it_max_2017

    Joined:
    Mar 8, 2018
    Posts:
    2
    Hello! Having the same problem. Could you solve it?
     
  3. PBTools

    PBTools

    Joined:
    Mar 7, 2022
    Posts:
    48
    Hi, as stated in the description, manual and this thread it is not the tools objective or purpose to check distances to objects you want to cut. How you solve this: You should do these check before invoking the cut function in your game logic.
     
  4. PBTools

    PBTools

    Joined:
    Mar 7, 2022
    Posts:
    48
    See answer above. You have to implement this logic yourself, the "MouseBehaviour" script is just one implementation of CutterBehaviour.
     
  5. PBTools

    PBTools

    Joined:
    Mar 7, 2022
    Posts:
    48
    Answering all your three posts with this.

    1. You cannot add abstract scripts to GameObjects. This is how Unity/C# works. See Mouse/PlaneBehaviour for concrete implementations of CutterBehaviour.

    2. Toggling Separate Meshes will create distinct meshes for disjoint vertice groups, i.e. triangles that are not sharing any vertices. This means if you cut a humanoid shape by the legs, both the left and right leg will belong to its own mesh and gameobject. Setting this to false will add the left and right leg to one new mesh together, which is often undesired. This is how most other Mesh Cutters on the unity asset store work and what makes this tool more applicable to games.

    3. "Destroying" original gameobject is optional and can be disabled, either by the bool exposed in the inspector, or by overriding the callback functions in CutterBehaviour to suit your needs. The new "cut" meshes will always be instantiated as new gameobjects.
     
  6. PBTools

    PBTools

    Joined:
    Mar 7, 2022
    Posts:
    48
    1. As per the manual: "This script needs to sit on the object that holds the mesh renderer we wish to cut"
    2. This makes things much more complex. My advice is to separate the meshes before invoking the cut function and handling each mesh by itself.
     
  7. PBTools

    PBTools

    Joined:
    Mar 7, 2022
    Posts:
    48
    Thanks for the helpful writeup.
     
  8. PBTools

    PBTools

    Joined:
    Mar 7, 2022
    Posts:
    48
    I'm not sure I understand, does it or does it not work on your android device ? FYI the tool is tested and verified to run on Oculus/Meta Quest 2 which runs on Android, without issues.
     
  9. Squeyed

    Squeyed

    Joined:
    Aug 26, 2016
    Posts:
    38
    Hello PBTools,

    I just wanted to ask about a potential use for your asset. I have a bunch of line renderers on a 2D map, I convert them into meshes and then combine them into a single mesh, next I want to seperate the large combined mesh into seperate grid based chunks. Would this asset be able to do that? And would the resulting chunks maintain their UVs?

    Thanks for your time!
     
  10. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    441
    hi @PBTools !
    Thanks for this amazing asset. I am evaluating it right now to see how well it fits my needs and for now, I am having a blast.

    One thing that bothers me a bit:
    Are there any guides on mesh creation to be well cuttable?

    I found that some of my meshes don't work super well. I think it might be connected that the problematic meshes have sub-meshes. Is it possible?

    The issue that I am facing is that some parts of the mesh are missing after cut and/or there are no new faces applied in places of the cut, etc.

    I am wondering how to assess if mesh is a good candidate to be cut and how to improve the quality of the mesh to be better at cutting.
     
  11. tlarson1188

    tlarson1188

    Joined:
    Jul 19, 2018
    Posts:
    1
    Hi @PBTools ,

    I really appreciate this tool and it is exactly what I needed for my VR game. That being said I have a few questions I hope you'll be able to answer.
    1) I'd like to set it so that the created meshes do not inherit all of the components of the initial mesh. For example my object has a NavMesh Agent component on it and when I cut the animated enemy the pieces ragdoll but then roll after me since they inherited the navmesh agent component. It's amusing if not a bit macabre but not what I'm aiming for.
    2) The other issue is that sometimes when cutting a mesh it duplicates and I end up with multiple of the same mesh such as 2 heads or torsos. I selected the Destroy bool so it should be deleting the original but it still occurs on occasion.
    3) The last issue might be something I messed up when setting up the ragdoll but on mesh cut the top half always separates from the lower half even if I only cut the head off. Torso and legs tear apart at the waist and the feet separate from the legs.

    Thanks and hope to her back soon.