Instanced Masked Material with Apex Cloth not working

Hey there,

I’m trying to make a scarf that can be made longer or shorter. The scarf uses Apex Cloth and the material shows or hides more based on a single parameter.

This is the material setup:

The TexCoord has Utiling of 2.0

The Sine is 4.0

SphereMask Radius is 0.01

In action, it looks like this:

So my problem comes in when I try to use this on anything with APEX cloth physics. It just doesn’t work.

At first I thought it was because it was a skeletal mesh, so I tried it on one and the material worked fine. There doesn’t seem to be anyone else who has encountered this specific issue.

If you want to know why I’m trying to accomplish this, I plan to use the scarf as a method of telling how much health the player has. So if anyone has any other suggestions, I’d be happy to try and implement those as an alternative.

Thank you,

-Metric

Flags Used with Skeletal Meshes and Used with Clothing must be checked.

This was added to apex cloth asset in “Content Examples” project map “Cloth”, and it works fine for me

What exactly do you mean by checked? Is there a check box somewhere, or is a check performed in the material?

Thanks.

This is checkbox inside material (not material instance)

I see. Under the Details panel there’s two check boxes for “Used with Skeletal Mesh” and “Used with Clothing.”

Both of these options are checked by default it seems. So I don’t believe that to be the problem. I’ll try exporting the cloth over from the Content Examples and add code similar to what you had and create a Material Instance and see if that works.

I can also test it on Owen in the Content Examples as well, if it works there and doesn’t on my own skeletal mesh, I’ll know there’s a problem there I guess.

After further testing I have confirmed that what you’ve said is correct. That material setup does work with clothing and skeletal meshes.

It seems that the issue therefore lies within my skeletal model or the apex physics asset. Any ideas?

Edit: Another weird thing I discovered is that with the Health parameter set at 51.00 the scarf is full. But the moment it gets set to 50 or lower it’s just completely gone.

http://imgur.com/lB95XHz here’s a gif to show you what I mean. It just pops in and out of existence despite the small change. Everything is UV mapped.

Can you show it’s UVs layout?

Example material on that image uses UVs G channel to provide vertical gradient for masking. Maybe you need to use R channel, because UVs on that model oriented differently

I think I figured it out. Thank you so much for your help. It seems to be because the flag and scarf on the character weren’t taking up enough UV space. I separated them out from their base mesh and scaled the UVs up and it works now.