Search Unity

Workflow to add new characters with the latest version?

Discussion in 'FPS.Sample Game' started by Kriszo91, Sep 16, 2019.

  1. Kriszo91

    Kriszo91

    Joined:
    Mar 26, 2015
    Posts:
    181
    Hello!

    I'm struggling to get the right way to add new characters to the system, problems are starting at Skeleton auto process, its hashing totally different the imported models even it has the same bone structure, than its can't find the required bones for "leftToeBone", "rightToeBone" in the AnimGraph_Stand, if im changing the has manualy for these bones from the original two character the next problem is "targetBone" and "drivenBone" in the AnimGraph_TwoBoneIK, after manual change these hashes the next problem is "colliderParentBone = skeleton.bones[ownerBoneIndex];" in the HitCollisionSystems, created the collider version of the character, so i can't find a good way to add characters at all, anyone changed the characters successfully? if yes, how?

    Thanks!

    Next problem is with adding weapons.
     
  2. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
    I have added my own characters more than 6 month ago so my memory might be a bit rusty.
    But I did indeed have the same problems as you describe so I found a different solution. Im not sure if you can use this for your project.

    But I added my own characters, with only 63 bones (Unity uses 127 or something) on top of the Terraformer prefab.
    Then I simply unchecked the terraformer geometry and updated a few references in the relevant scripts. Like right hand attach etc...

    The result is that Unitys Terraformer and my own character now mores together in sync but as I have disabled the terraformer you can only see my model.

    The problem with this is that it can produce some strange artefacts. But overall it works.

    These days we have changed our player models to robots and again I used the Terraformer prefab sceleton. I know there is a robot character in Unitys sample but I would rather use the Terraformer until I have solved the problem the right way.
    So with these new robots I simply add each body part directly onto the Terraformers bones in its prefab.
    Again I disable the Terraformer geometry so now my robot body parts is moved by the Terraformer sceleton.
    For the most parts it works fine although I need to keep the sceleton size and thats not good for me in the longer run.

    We have 4 different robots and we want them to be difference size etc...

    What I did to make these was to open the terraformer model with its sceleton in 3dsMax and then modeles my robot parts on top of the sceleton.

    This only works for robots as you can no longer use skinned meshes and thereby deform them by the bones.
    But I need robots so thats not a problem right now.

    My goal, and I guess yours as well, is to make a fully model in my 3d app and then simply export and replace it in the prefab. But as you know this will mess with the sceleton hashes. And propably many more things.

    But... What I have not tried yet.
    Is to load the terraformer with sceleton in 3dsMax and export it as it is and see if that works.
    Just as a test to see how the hashes behave.

    Hope this somehow get you moving forward :)
     
    AggressiveMastery likes this.
  3. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
  4. Kriszo91

    Kriszo91

    Joined:
    Mar 26, 2015
    Posts:
    181
    Wow, thats a lot of info, thank you for your reply, i deep dived in and seems the key is to have the right named bone structure, anyways i will try out your solution!
     
  5. Kriszo91

    Kriszo91

    Joined:
    Mar 26, 2015
    Posts:
    181
    Any idea for crouch and for weapon zoom to sight?
     
  6. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
    For both crouch and weapon zoom you need to make your own animations to switch into.
    For the weapon zoom just changes the cameras FOV in code.

    There is a crouch animation in the FPS sample but its not moving in any directions. So when you crouch your either cant move or it will snap back up into standing position. But that could be fixed with new animations.
     
    AggressiveMastery likes this.
  7. Kriszo91

    Kriszo91

    Joined:
    Mar 26, 2015
    Posts:
    181
    Okay, a littlebit hard to understand this animation system and the abilities, i found where to add new key command but not really foud where the animation clips are being played on key press
     
  8. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
    There should be tons of tutorials online to show you how to add animations and using the animation controller to get what you need.
     
  9. bigboxbarry

    bigboxbarry

    Joined:
    Mar 22, 2020
    Posts:
    2
    A bit late for this, but I have the same question but i need more clarification.
    If I create a new character model in a different application, and import it and change the mesh of the character and then do that 4 times, will I have 4 characters or willi have to add additional script?
     
  10. AnanasStudios

    AnanasStudios

    Joined:
    May 15, 2021
    Posts:
    5
    Anyone knows a video etc. that describes this?