UTPS + UIS for multiple player characters?

Hello,

In my game I have two player characters male and female, the player will be able to play as one of them depending on what character they created, so all the setup will be done once when the scene loads. I used to do this with my own controller in previous games by just saving the ID of the created character and activating one of the child characters accordingly (I still had to reference the skinned mesh and a few bones).

I have noticed that some components directly reference the fbx transforms (bones most of the times), while others reference objects created by UCC (like Items) which again are parented directly to the character fbx.

The components that Im talking about which need to set up those references depending on the current character are:

-CharacterFootEffects
-CapsuleColliderPositioner
-CharacterIK - will need different values for the IK since the characters bodies are different
-Animator - switch the avatars

I think there are more that I've missed.

I need a way to reference everything dynamically when the scene loads, or maybe there are presets for multiple characters which Im not aware of.

My last question is if Im able to upgrade from UTPS to TPC with a discount, I bought it from your website and if its easy to update my existing characters to use the melee features.
 
Last edited:
I would take a look at Unity's prefab variants feature. You can make one base character prefab and have variants of that prefab with different models, components, etc. and just spawn a specific variant.
 
To be honest, I still don't trust unity prefabs and want to avoid them for things other than UI. I don't want to have different components because the two characters will have the exact same abilities etc, the only difference would be their FBX and maybe some IK adjustments.
 
A multiplayer game I'm helping with uses prefab variants in this exact way - multiple characters with different models but with everything else identical. As long as you make sure to only ever edit the root prefab when making any changes to UCC components, abilities, etc. then it works just fine.
 
@Andrew Okay, but here comes the question how Im going to set up and reference the 2nd prefab variant, if I already have all of the UCC components sitting on the Root, should I manually reference the new character's bones and create the helper game objects (such as Items) or I can still use the Tools UI to auto setup my 2nd character (in case it wont override the existing components or add them twice).
 
What do you need to reference individual bones for exactly, and how are you doing that? Depending on what you're doing, you may be able to either reference the root prefab's bones in your script's inspector (or reference them on each variant separately), or create a middleman component that sits on your variant and contains a public reference to the bones and whatever else you need to access, which you can then access from your own script.
 
I dont need to reference anything other than the skinned mesh with my own scripts, but the UCC scripts are referencing some of the bones - for example CharacterFootEffects is referencing the toes, so in my 2nd prefab Id have to make it point to the male's toes. I don't know if I have to manually do it or run the setup from Tools once again.

CapsuleColliderPositioner also keeps track of the head bone.
 
With prefab variants, each variant is a separate gameobject, so you won't need to worry about UCC components referencing their own bones etc.
 
Okay, thanks for the help.

To confirm - I can take my existing female character and make a prefab out of it then another prefab variant for the male.
Delete the female fbx from the male variant and add male fbx, then go to the variant root and re-assign every bones that UCC needs. When Im working on character abilities etc I must work on the female root and all the changes will go to the male.
 
Yeah that sounds right. UCC components can be kind of fragile with prefab variants (values getting overwritten etc), so as long as you only modify them on the root prefab you'll be fine. I'm still not exactly sure why you need to re-assign bones manually though. (The character manager can probably do this for you?)
 
Yeah that sounds right. UCC components can be kind of fragile with prefab variants (values getting overwritten etc), so as long as you only modify them on the root prefab you'll be fine. I'm still not exactly sure why you need to re-assign bones manually though. (The character manager can probably do this for you?)

I have never tried this and I see bone references in scripts, so when I swap the FBX they have to be updated somehow to point to the new skeleton transforms - either manually or automatically through the character manager.
 
I would take a look at Unity's prefab variants feature. You can make one base character prefab and have variants of that prefab with different models, components, etc. and just spawn a specific variant.
Andrew,

I think this is something I am looking for, can you explain your workflow a bit please?

As per the OP, male/female variant.

Create male version with UIS and UCC.
Create female prefab variant of above (No need to redo origional UIS and UCC steps)?

And can you answer:

Variant can have different skinned meshes?
Variant can have different rig (still humanoid)?
Variant can have different avatar (still humanoid) - male avatar or female avatar?
 
I haven't personally tested with that level of difference, but changing all of those things in the variant should be totally fine, as long as the rig and avatar are valid humanoids then there shouldn't be any issues.

A safer way to do it would be to have a base prefab, then 2 variants of that prefab - i.e. you wouldn't actually use the base prefab, only the variants. The reason for this is because it will be easy to change something about just the male variant without it affecting the female variant. (If the male version was the base and the female was a variant of the male, then any changes you make to the male base might affect the female variant.)
 
I haven't personally tested with that level of difference, but changing all of those things in the variant should be totally fine, as long as the rig and avatar are valid humanoids then there shouldn't be any issues.

A safer way to do it would be to have a base prefab, then 2 variants of that prefab - i.e. you wouldn't actually use the base prefab, only the variants. The reason for this is because it will be easy to change something about just the male variant without it affecting the female variant. (If the male version was the base and the female was a variant of the male, then any changes you make to the male base might affect the female variant.)

Okay, so to recap we can make a base prefab:
-BaseCharacter - this will hold all of the shared components between the male and the female, but it won't be used in game, so the FBX can be whatever

then we can create 2 variants from the prefab above:
-FemaleVariant
-MaleVariant

Now if we decide to make a change that affects both we can tweak BaseCharacter, but if we want to have something unique to the female we only touch the FemaleVariant?

What Im worried is the amount of component references and game objects that are attached to the character's bones and those will have to be reassigned and recreated manually, as @Justin told me "Switching character rigs is a pain. There really isn't a good way to do it other than being very meticulous with ensuring all of the components/GameObjects have been added or creating a new character from scratch."

So everytime we create a new character variant, it would be the same as switching character rigs as we delete the BaseCharacter's FBX and insert the new one.
 
Yeah your description of the prefab variant setup is perfect.

Unfortunately there's no easy way around that issue as far as I know. Using different rigs is indeed a pain.
 
Top