Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessing material of chopped rope
#1
Hi there,

I am going through the docs and I amĀ unable to find a way to access rope material at runtime. Is it possible to change material / fade the chopped part of the rope ?
Reply
#2
(05-10-2019, 05:38 PM)superdev Wrote: Hi there,

I am going through the docs and I amĀ unable to find a way to access rope material at runtime. Is it possible to change material / fade the chopped part of the rope ?

If by "material" you mean the renderer's material, you get it from Unity's MeshRenderer:
Code:
rope.GetComponent<MeshRenderer>().material;

You could set the alpha value to zero in the particle's color when they are torn, then reading the vertex color in your rope's shader. That would fade out vertices adjacent two a cut.
Reply