Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Run time Character Clothing
#1
Hi, 

Is there any way to make a cloth for the character on runtime?
I want to instantiate my character in multiplayer.

Thank you.
Reply
#2
(24-02-2019, 07:50 AM)VrTech Wrote: Hi, 

Is there any way to make a cloth for the character on runtime?
I want to instantiate my character in multiplayer.

Thank you.

It highly depends on how you're planning to set up cloth for your characters.

- Is it part of the same mesh as the character?
- Is it a separate mesh skinned to the same skeleton?
- Are you planning to allow multiple cloth objects to be switchable at runtime?

The basic idea is always to make a prefab out of your cloth, then at runtime instantiate it and set up any additional stuff (like parenting it to the appropriate transform). Cloth is like any other GameObject in Unity, so all rules that apply to prefabs apply to it too.
Reply
#3
(25-02-2019, 07:45 AM)josemendez Wrote: It highly depends on how you're planning to set up cloth for your characters.

- Is it part of the same mesh as the character?
- Is it a separate mesh skinned to the same skeleton?
- Are you planning to allow multiple cloth objects to be switchable at runtime?

The basic idea is always to make a prefab out of your cloth, then at runtime instantiate it and set up any additional stuff (like parenting it to the appropriate transform). Cloth is like any other GameObject in Unity, so all rules that apply to prefabs apply to it too.

Hi,

Is it part of the same mesh as the character?
 - I have the one with the same mesh. However, I would like to know more in case it is not the same mesh also.
Is it a separate mesh skinned to the same skeleton?
 - It's not a separate mesh skinned to the same skeleton
Are you planning to allow multiple cloth objects to be switchable at runtime?
 - Yes, I think. What do you mean by switchable? I just want to make it work when I instantiated my character Sonrisa

Please Help, thank you!
Reply
#4
(25-02-2019, 08:17 AM)VrTech Wrote: Hi,

Is it part of the same mesh as the character?
 - I have the one with the same mesh. However, I would like to know more in case it is not the same mesh also.
Is it a separate mesh skinned to the same skeleton?
 - It's not a separate mesh skinned to the same skeleton
Are you planning to allow multiple cloth objects to be switchable at runtime?
 - Yes, I think. What do you mean by switchable? I just want to make it work when I instantiated my character Sonrisa

Please Help, thank you!

In that case, you simply need to instantiate your character. There's nothing special that needs to be done for it to work.

(Assuming that your cloth is being simulated in local space and the solver is at the character's root, as indicated in the manual, though.)
Reply
#5
(25-02-2019, 09:03 AM)josemendez Wrote: In that case, you simply need to instantiate your character. There's nothing special that needs to be done for it to work.

(Assuming that your cloth is being simulated in local space and the solver is at the character's root, as indicated in the manual, though.)

The problem is that when I put the cloth simulated in local space and the solver is at the character's root. It looks nice in Prefab Editor.
But when I instantiate the model, it got an error. All the points in my cloth have been removed.

   

(25-02-2019, 09:17 PM)VrTech Wrote: The problem is that when I put the cloth simulated in local space and the solver is at the character's root. It looks nice in Prefab Editor.
But when I instantiate the model, it got an error. All the points in my cloth have been removed.


[attachment=261]
Reply
#6
(25-02-2019, 09:17 PM)VrTech Wrote: The problem is that when I put the cloth simulated in local space and the solver is at the character's root. It looks nice in Prefab Editor.
But when I instantiate the model, it got an error. All the points in my cloth have been removed.




Seems your solver is not part of the prefab. When you instantiate a prefab, all references to anything in the scene outside the prefabricate are lost. Just make sure the prefab contains the ObiSolver component.
Reply
#7
(26-02-2019, 08:23 AM)josemendez Wrote: Seems your solver is not part of the prefab. When you instantiate a prefab, all references to anything in the scene outside the prefabricate are lost. Just make sure the prefab contains the ObiSolver component.

So I also did try on your Trench coat example scene. I make your character as a prefab and then instantiate the character on the game.
It shows the same error. The cloth is not working this way.

Any idea to make this workable?

Thank you.
Reply
#8
(27-02-2019, 05:10 PM)VrTech Wrote: So I also did try on your Trench coat example scene. I make your character as a prefab and then instantiate the character on the game.
It shows the same error. The cloth is not working this way.

Any idea to make this workable?

Thank you.


Hi,

This has been done in 2018.3.6 latest version of Unity
The prefab instantiated with cloth is not registered to the game.

Try to do this
Model with Cloth -> Make a Prefab -> Edit Cloth Particles in Prefab -> Exit Prefab -> Re-enter Prefab -> The Cloth Particles lost.

So apparently, the Prefab in the new version of the Unity cannot hold your particles information.

Please help.
Reply
#9
(02-03-2019, 12:41 AM)VrTech Wrote: Hi,

This has been done in 2018.3.6 latest version of Unity
The prefab instantiated with cloth is not registered to the game.

Try to do this
Model with Cloth -> Make a Prefab -> Edit Cloth Particles in Prefab -> Exit Prefab -> Re-enter Prefab -> The Cloth Particles lost.

So apparently, the Prefab in the new version of the Unity cannot hold your particles information.

Please help.

Hi,

We're unable to reproduce this. Same Unity and Obi versions.
When editing particles in prefab mode, all edit operations are correctly performed. See this video:

Reply
#10
(02-03-2019, 08:48 AM)josemendez Wrote: Hi,

We're unable to reproduce this. Same Unity and Obi versions.
When editing particles in prefab mode, all edit operations are correctly performed. See this video:


   

Sorry, I can't see the video

Thank you.
Reply