Unity5: alternative to Cloths?

Hello

As I understand, clothes were rewritten, are faster, and now only usable to dress your characters like if you were playing with Barbies. A lot of other uses, like as a parachute or a flag, are no longer supported.

What is the current approach to create a flag-like object? Manually program it? We no longer have the possibility to add colliders to some specific points of the cloth, or adding a join or anything.

Is there any straightforward alternative?
(yeah, I know there are some flags being sold in Asset Store, but not sure if they will work with Unity5, now!!)

Thanks for any hint
Alberto

Is the flag going to collide something, or respond to wind or something else?
Or could just have a waving vertex effect on a plane?

If you want to make a flag, create plane & add cloth component > add the plane mesh to the skinned mesh renderer > edit constraints and constrain on one edge > use external acceleration for wind.

1 Like

That almost works, but since Unity doesn’t render backfaces, the flag appears invisible from the opposite side. Is there any way to fix this?

Isn’t a double-sided shader what’s normally used?

You need to turn ‘Backface Culling’ off. See also this Manual page: ShaderLab: Culling & Depth Testing

Basically, you write ‘Cull off’ in the Pass of the SubShader. Download the Built-in shaders from the Unity Download page (it’s under ‘Additional Downloads’), copy the Standard.shader out of the .zip file into your project and edit it with MonoDevelop.

2 Likes

Hey

Thank you all for the answers. I’ll try to follow your suggestions. On the “one-side only” problem, I usually did that with two panes, one in each direction. But if changing the shader also works, I will dig that.

But as far as I could understand, I will need to turn of gravity, right? As the constrain does not force the object not to move.

Thanks
Alberto

Thanks! I did that, and it nearly works, but I noticed that the shadows/lighting don’t appear correctly when viewing the object from the reverse side. Examples:

From the front of the plane, the sphere casts a shadow:

After rotating the plane 180 degrees around the Y axis (no other changes to the scene), there’s no more shadow, and the lighting looks different:

I just added “Cull Off” into each SubShader Pass (I attached the edited version of the shader for reference). Is there something else I should be doing?

Thanks!

2069582–135017–StandardCullOff.shader (8.46 KB)

Wonderful. Thanks!

Just to correct me, gravity in the cloth component is not the “default” gravity, so, it is ignored by constrained nodes.