Code for Slicer

Hello, I’m new into Unity 3D and C#.
I’m looking for some help with the following:

  • I have a Unity scene with an object and I want to be able to slice the object with a slider button.
  • I want to be able to slice the object in x, y or Z.

Thanks
Luis Mestre

This will be shader work I expect, at least the visuals. You might find a dissolve shader tutorial useful, just without the glow. You can do this with the built in Shader Graph no code required.

See what this guy does at 14:16 in this video. I think that’s what you’re looking for but one dissolver slider in each dimension instead of just on the Y:

If the collider needs to vary too, I assume this works, but never used it:

Other types of colliders have their own equivalents, for example:

Hi Thanks for the reply but what I’m looking for is a cross section slider, I want to be able to section a mesh and use a slider to slide the section plan.

Just a friendly suggestion then; you should try to ellaborate more when you ask a question otherwise it can be a complete guessing game when ambiguous questions are asked.

Its ok I’m new to Unity

1 Like