Posts: 15
Threads: 5
Joined: Apr 2018
Reputation:
0
24-02-2019, 07:50 AM
(This post was last modified: 27-02-2019, 05:10 PM by VrTech.)
Hi,
Is there any way to make a cloth for the character on runtime?
I want to instantiate my character in multiplayer.
Thank you.
Posts: 6,347
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(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.
Posts: 15
Threads: 5
Joined: Apr 2018
Reputation:
0
(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
Please Help, thank you!
Posts: 6,347
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
25-02-2019, 09:03 AM
(This post was last modified: 25-02-2019, 09:03 AM by josemendez.)
(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
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.)
Posts: 15
Threads: 5
Joined: Apr 2018
Reputation:
0
25-02-2019, 09:17 PM
(This post was last modified: 25-02-2019, 09:34 PM by VrTech.)
(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]
Posts: 6,347
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
(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.
Posts: 15
Threads: 5
Joined: Apr 2018
Reputation:
0
(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.
Posts: 15
Threads: 5
Joined: Apr 2018
Reputation:
0
(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.
Posts: 6,347
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
02-03-2019, 08:48 AM
(This post was last modified: 04-03-2019, 08:14 AM by josemendez.)
(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:
Posts: 15
Threads: 5
Joined: Apr 2018
Reputation:
0
02-03-2019, 10:43 PM
(This post was last modified: 03-03-2019, 08:05 AM by VrTech.)
(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.
|