Search Unity

Controller Third Person Templates by Invector

Discussion in 'Tools In Progress' started by Invector, Aug 20, 2015.

  1. imback21

    imback21

    Joined:
    Nov 30, 2015
    Posts:
    10
    Did this support with Atavism Online Engine for MMO ?
     
  2. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hmmm I did not know this asset, I took a quick look and apparently they have they own custom controller and works with the old Legacy system. I'm not saying that is impossible, but it will certainly take some time to adapt and put all pieces to work together.
     
  3. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    Horay! I re-created my character as it's all working now! Possibly a glitch somewhere, but it's working and I'm very pleased.
    Thank you for helping on a Sunday too! Amazing support!
     
    Invector likes this.
  4. imback21

    imback21

    Joined:
    Nov 30, 2015
    Posts:
    10
    I see i will ask them about it first.
    Thank you
     
    Last edited: Dec 14, 2015
  5. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    Loving this asset! I can't say this enough!
    I've noticed an issue when trying to jump onto an object that your standing against. It looks like it registers the object is in the way and stops jumping so you can't jump high enough to clear the edge and land on the object. Can you let me know how to fix this?
     
  6. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I've noticed that issue this week, I guess it's something to do with the rigidbody pushing forward :confused:
    I will take a further look at, but here is a quick fix for you @DanBanner , open the ThirdPersonAnimator script and search the method JumpAnimation on the and add this extra line on both Jump and JumpMove

    Code (CSharp):
    1. // apply extra height to the jump
    2.                 if (stateInfo.normalizedTime < 0.85f)
    3.                 {
    4.                     _rigidbody.velocity = new Vector3(_rigidbody.velocity.x, jumpForce, _rigidbody.velocity.z);
    5.                     transform.position += transform.up * (jumpForce * Time.deltaTime);
    6.                 }
    this transform.up should give a extra boost for the character, so you may have to lower your jumpForce value just a little bit
    Give a try and let me know what you think ;)
     
  7. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    It's working alot better thank you!
     
  8. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    I can't track down the code to turn off the ragdoll effect.

    The problem I'm having is that I want to make the character move to a respawn point when he dies. The code below runs when the character dies and moves him to the respawn point, but the character is still in ragdoll mode and locked so cannot be controlled.

    Ideally I would like the ragdoll effect to remain on for 5 seconds (without standing up, obviously because he is dead) and then relocate to the respawn alive and well and ready to be controlled. But I cannot find the 3 controls needed, the one that controls the ragdol, the one that locks the player and the one that will stop the character standing up when he is dead.

    Here is my code that I've added to the "character.cs" script...


    Code (CSharp):
    1. public void TakeDamage(int amount)
    2.         {
    3. // ....
    4. // If the player has lost all it's health and the death flag hasn't been set yet...
    5.             if (currentHealth <= 0)
    6.             {
    7.                 // create and call here a method to die
    8.                 Debug.Log("Player has DIED!");
    9.                 StartCoroutine(Dead());
    10.             }
    11.         }
    12.  
    13.         //**********************************************************************************//
    14.         // Player is DEAD                                                                    //
    15.         //**********************************************************************************//  
    16.         IEnumerator Dead()
    17.         {
    18.             Debug.Log("dead");
    19.             yield return new WaitForSeconds(3);
    20.             // Get objects for both player and respawn
    21.             GameObject player = GameObject.FindGameObjectWithTag("Player");
    22.             GameObject respawn = GameObject.FindGameObjectWithTag("Respawn");
    23.  
    24.             // Hide player
    25.             player.gameObject.SetActive(false);
    26.  
    27.             // Relocate player to the respawn point
    28.             player.transform.position = respawn.transform.position;
    29.  
    30.             // Show player
    31.             Debug.Log("respawn");
    32.             player.gameObject.SetActive(true);
    33.  
    34.             // Reset health and stamina
    35.             currentHealth = startingHealth;
    36.             hud.healthSlider.value = currentHealth;
    37.             currentStamina = startingStamina;
    38.             hud.staminaSlider.value = currentStamina;
    39.         }
    It would be nice to have a respawn facility built into the controller as there appears to be a respawn tag, is this something in the pipeline?
     
  9. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hey @DanBanner you can check for the currentHealth on the method RagdollStabilizer, our ragdoll auto stand up when the rigibody of the hips stabilize, so before the script call the method for stand up, you can put this verification

    Code (CSharp):
    1.  if (tpController.currentHealth > 0f)
    2.             {
    3.                 //Debug.Log("Ragdoll Stable");
    4.                 ragdolled = false;
    5.                 // reset original setup on tpController
    6.                 StartCoroutine(ResetPlayer(2f));
    7.             }
    The ResetPlayer method will make sure to reset the player for default behaviour and the ragdolled bool also prepare the script to hadle another ragdolled.

    We don't have anything about a respawn system in the pipeline, but now that you comment about I'm making one right now lol and brace yourselves, v1.1b is coming :eek:
     
    DanBanner and jayimagination like this.
  10. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Pretty cool video about Humanoid features, retargeting animation from one model to another, how to set up animation clips properly, etc... I really recommend!

     
    jayimagination likes this.
  11. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    Great news about v1.1b! I can't wait.

    I have followed your advice and got my player to stop getting up but I don't know where or how to correctly call the "ResetPlayer". I am thinking it needs to be called from the ThirdPersonController script as that is where the player is moved to the spawn point.
    Is it worth me persuing a re-spawn system if you are working on one now?
     
  12. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    When using my own character, it doesn't fade out when the camera gets close and we end up seeing inside the character. I've adjusted the "Distance to Start Fade" and "Distance to End Fade", but neither to anything. Do I have to setup something else for the fade to work?
     
  13. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Take a look at the documentation @DanBanner, if you are using the Unity's Standard Shader just check if the Rendering mode is on Fade, and if you are using any other custom shader, just make sure that they have a transparent effect and assign a copy of this material on the Optional Fade Material.

    About your other question, you can try to make your own respawn system or wait the next update which I intend to upload this Wednesday (23).
     
    jayimagination likes this.
  14. didea

    didea

    Joined:
    Dec 17, 2015
    Posts:
    1
    Last edited: Dec 24, 2015
  15. Gojira96

    Gojira96

    Joined:
    Jun 18, 2015
    Posts:
    32
    Hello,

    I just wanted to share a major bug fix I saw someone else had on the forum while trying to fix it.
    This "bug" caused me alot of headache so I decided to share what was causing it.
    There was no Camera,HUD,or event system being created,controller had no animations.
    Top-Down worked,but not 3rd person.
    What happened is this error when trying to create a new Character:

    MissingComponentException: There is no 'Rigidbody' attached to the "3rdPersonController" game object, but a script is trying to access it.
    You probably need to add a Rigidbody to the game object "3rdPersonController". Or your script needs to check if the component is attached before using it.
    CreateCharacterEditor.Create () (at Assets/Invector-3rdPersonController/Scripts/CharacterCreator/Script/Editor/CreateCharacterEditor.cs:214)
    CreateCharacterEditor.OnGUI () (at Assets/Invector-3rdPersonController/Scripts/CharacterCreator/Script/Editor/CreateCharacterEditor.cs:127)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)



    In my case,what was causing this problem was a free Asset from the Unity Asset Store called "Fantasy Skybox FREE" (https://www.assetstore.unity3d.com/en/#!/content/18353),
    something I least expected.
    Hope this helps someone because it caused alot to pain to me :)

    btw. Any progress on playmaker actions?
    Turn on/off ragdoll action could be really useful in my project.

    P.S. Anyone who still wants to use "Fantasy Skybox FREE" ,you can,you just need to open it in a different project and export just the skybox with its textures and Materials.The asset has a lot of irrelevant things within it which probably causes the error.
     
    Last edited: Dec 24, 2015
  16. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Make sure that your layers are set up correctly, also check JumpAirControl, I've made a few improvements on the jump feature, it will be online on 1.1b. I will be uploading this new version monday 28 :)

    wow I will definitely download this asset to see why this errors happen, big TKS to report this @Gojira96
    And about the Playmaker, we bought and saw some examples... but honestly I have no ideia what you guys want for integration with this asset lol, can you give me some examples? For me looks like it's super helpful to trigger events with the level and stuff.

    ps* I'm going out for a few days guys, see you at monday 28
    ps²* Merry Christmas :D
     
    Last edited: Dec 24, 2015
  17. Gojira96

    Gojira96

    Joined:
    Jun 18, 2015
    Posts:
    32
    No problem :)

    About Playmaker,as I said,what would be really helpful to my project is Turn ragdoll on/off playmaker action,nothing else.I am trying to keep my project simple and mostly done in playmaker.My project has a lot of ragdolling,some on command,some on collision and events and is an important part of my game since the player cannot die.

    Merry Christmas :)
     
  18. AllenExia

    AllenExia

    Joined:
    Dec 26, 2015
    Posts:
    1
  19. imback21

    imback21

    Joined:
    Nov 30, 2015
    Posts:
    10
    Can you help to connect into Atavism Engine ? We use Humanoid Mechanim also Animation Controller suited for it.
     
  20. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Annnnd we are back :) sup guys

    @Gojira96 take a look at the "ObjectDamage" script, it's just 1 line to activate the ragdoll and you can do it by trigger or collision, really simple.

    Just go to Edit > Project Settings > Input and look for the crouch button with is Y, just change the current "Alt Positive Button" which is C to LeftControl.

    Hmmm this maybe a complex adaptation, but we sure can try, send me a private message with more details :)
     
  21. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    still no shooter package ?
     
    jayimagination likes this.
  22. jayimagination

    jayimagination

    Joined:
    Dec 20, 2012
    Posts:
    89
    I'm looking for the samething..hopefully some new info, video or something.
     
  23. peter_rodrigues

    peter_rodrigues

    Joined:
    Jan 28, 2014
    Posts:
    39
    I would love some info on the shooter package especially if there is melee combat even simplistic as it would really get my game rolling as Im better at building levels and not so good with scripting/animations.
     
    jayimagination likes this.
  24. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    We are still focusing on the v1.2 guys, once this build is complete then we will move onto the Shooter Add-on.
    Sorry it's taking so long D: but you guys can expected the same quality as this package ;)
     
    jayimagination likes this.
  25. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    it's more than a year i was waiting T_T
     
  26. JohnPet

    JohnPet

    Joined:
    Aug 19, 2012
    Posts:
    85
    Will you eventually add sometime turning/leaning animation parameters? The standard assets character does this for sharp turns while moving.
     
  27. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I know dude, me too o_O - but I have a feeling that next year will be awesome :D

    The sharp turn that the standard asset make is a animation and uses root motion to do it, I personally hate that movement, make the character slow down a lot... Maybe we will figure out a way to do this with IK by leaning the character a liltle bit you know? let's see how it goes in the future.

    Speaking about the future, guys here it is the agenda for the next few months, We were going to publish the v1.2 with a lot of features, but since there is so many ready to go, we will release the v1.1b for you guys first :)

    - Release Update v1.1b (I will upload this TODAY btw) which will include:
    - Release Update v1.2 which will include:
    Then we will focus on the Shooter Add-on, that will include:
     
    Last edited: Dec 30, 2015
  28. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    hey dude any early prototype for shooting make me your early tester / adopter :D
     
  29. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I have 3 or 4 guys in that list, and you Sr. @blackbird is one of them :cool:
     
    blackbird and jayimagination like this.
  30. jayimagination

    jayimagination

    Joined:
    Dec 20, 2012
    Posts:
    89
    ;)
    Hope I'm one of them too;)
     
    Invector likes this.
  31. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Any oldschool dev fan of Resident Evil / Alone in the Dark / Dino Crisis around? :D

    Next update v1.1b will bring this new Demo Scene with our V-Mansion to show the new CameraMode > Fixed Point. You can easily set up multiple points and switch between by a trigger, you can also combine Free Directional / Fixed Angle and Fixed Point to create unique moments for your game, becoming more dramatic and cinematographic.








     
    Last edited: Dec 31, 2015
    jayimagination and Gojira96 like this.
  32. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Here it is the complete changelog of next update guys:

    @Carlos Rovira you don't need to change your animations root motion with a 3D editor anymore, we add support for non root-motion :)
    @DanBanner We make a spawn system, now you can make a Prefab and Instantiate the Player :)
     
    Last edited: Jan 4, 2016
  33. Pat19645

    Pat19645

    Joined:
    Apr 17, 2014
    Posts:
    14
    Still V1.1a in asset store.
    Looking forward for melee & enemy ai ;)
     
    Last edited: Dec 31, 2015
  34. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Yeah we upload yesterday but the AssetStore still needs to approve in like 5 days
     
  35. Pat19645

    Pat19645

    Joined:
    Apr 17, 2014
    Posts:
    14
    Ok :)
     
  36. jayimagination

    jayimagination

    Joined:
    Dec 20, 2012
    Posts:
    89
    Sweet. Addition to the template. Please consider an over the shoulder camera like resident evil 4-6, GOW series, and evil within...for an future update or even the shooter template...
    Also I know a first person state camera will be apart of the shooter but please consider a button for an option to switch to first person camera..like star wars battlefront 3..that would be awesome!
     
  37. Kiwi-Hawk

    Kiwi-Hawk

    Joined:
    Jul 17, 2015
    Posts:
    288
    Kia ora

    I just brought this because the default third person is disgusting, just runs in circles and as a start using Unity I have not learned enough to fix it,. I don't code and have trouble remembering enough to learn to.

    Anyway I have a test project I loaded this into and dropped the V-Bot into a demo scene from the Medieval Environment pack to run round and have a wee check it out put their main camera from the First person they had in there on the V-Bot and removed the first person. I don't know if this gonna work because I get:

    Assets/Invector-3rdPersonController/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs(8,18): error CS0101: The namespace `UnityStandardAssets.CrossPlatformInput.Inspector' already contains a definition for `CrossPlatformInitialize'

    in the console, if this is a change some name or comment out a line can you please let me know how to fix this.

    I'm really close to being done with Unity cept for the money I spent. EVERY package I buy of the asset store has hard drive blot of the default assets, buy 10 packages get 10 copies of the Default assets and EVRY one of them break the package you buy in some way, but sorry this is the wrong place to rant. I'd jus like to get a start on running a third person char about. I brought this https://www.assetstore.unity3d.com/en/#!/content/46366 and his base models off the asset store on the hope I can to the point I can use a char in the same way I do in Skyrim, eg pop from first to third person lot chests to change armours and cloths but he has no knowledge of how to get that into Unity,he's a modler and graphic artist. I'll worry bout getting that done after I figure how to correct the about script error so I can at least have Unity compile so I have a game mode
     
  38. JohnPet

    JohnPet

    Joined:
    Aug 19, 2012
    Posts:
    85
    About the leaning, yes the sharp turn does indeed slow down the player because they use root motion, but I guess it can be done without it. If you notice , even some old platformers use this, though what the math behind would be, no one knows... If you ever code it, don't use root-motion.
     
  39. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Our camera already has a state over the shoulder, and it's very easy to customize you just need to change the Right, Height and Distance values to get the position that you want. I'm going to make a video tutorial about our Camera system soon, maybe this will make things more clear for you guys :)

    Take a look at this video tutorial, what is happening is that you have the script CrossPlatformInput duplicated on your project folder, that's why this error is showing up. Btw everytime you guys see the error "The namespace 'script' already contains a definition for 'script' " is because you have duplicated scripts.
     
    jayimagination likes this.
  40. peter_rodrigues

    peter_rodrigues

    Joined:
    Jan 28, 2014
    Posts:
    39
    I havent updated yet but the mansion looks great in the web player. My question though regarding the fixed camera angles. Whenever you go into aim mode, your character only faces one direction so if you have an enemy on screen that is behind you then you wont be able to look at the enemy. Is it possible to have it go into the regular aim camera mode instead of staying at the fixed camera angle or do you have any work arounds with this?

    On another note - Are you taking suggestions/requests for things to add? I know you want to get to work on the shooter template and believe me, so do I but for right now I would like to build my levels around things that the character can do. The ladder climb was extremely helpful and Im glad you added it in. If you are taking some suggestions I have a few.

    • Pushing/Pulling objects (Great for puzzles)
    • Ledge walk so your character can walk on ledges or squeeze through cracks or tight spaces.
    I think adding these two things would make for an almost complete package
     
    Last edited: Jan 2, 2016
    jayimagination likes this.
  41. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Oh actually I forgot to test the aiming mode on this scene :eek:
    But it's really simple to enter the aiming mode, just add "if (changeCameraState && !aiming)" into the first if statement at the ControlCameraState() method inside the ThirdPersonController script.

    Guys don't forget to backup your current project before update!!

    We are holding on some requests that require animations because we have a friend who order the Perception neuron mocap suit, but your 2º request specifically is really easy to do if you already have the animations, just make a trigger to enter the state and other to exit, and a blend tree state on the Animator to blend you left/right animations or forward/backwards in the squeeze situation.
     
    jayimagination likes this.
  42. andrewpstern

    andrewpstern

    Joined:
    Jan 2, 2016
    Posts:
    3
    Thank you for this excellent package! I've been playing with it and like it a lot.

    I'm interested to adapt it to control locomotion of NPCs. Using the "aiming" mode (step-walking), we need our NPCs to locomote short distances to precise locations. Any suggestions of the best way to adapt the "aiming" system to finish a short locomotion at a precise xz location on the ground?

    thanks!
     
  43. Kiwi-Hawk

    Kiwi-Hawk

    Joined:
    Jul 17, 2015
    Posts:
    288
    Kai ora

    I started a new project loading this only to create a base to start with and then loaded my terrain tools and the char packs.
    I followed the "First run" video best I could to the letter and got a char into my world but she is fixed in the T pose. I was trying to use this fully working char https://www.assetstore.unity3d.com/en/#!/content/46366 thinking all the animation are there and she's good to go, but I guess the process drops out the animation that maybe on the char. I'll go back over and try again. I jus found the tutorial is more for those who undertsand the process rather than a person starting out, or maybe I'm jus old, think and take in much slower and I missed some steps because I didn't know where things are found.
    The one thing that did confuse me was the difference between you screens and mine and the fact your cilider box was in the correct place but my char was half a body above the capsile.

    I did how ever love the fact that in the third person demo I could scroll the distance from the char, is it possible to change the settings so that it scrolls into first person? or set the flip from first to third like in Skyrim with a keybind? Yes I know I'm way haed of myself, I can't even get it working yet lol. One can dream
     
    Last edited: Jan 3, 2016
    jayimagination likes this.
  44. jayimagination

    jayimagination

    Joined:
    Dec 20, 2012
    Posts:
    89
    I'm wanting to do the same. If you figure it out please share. I know the upcoming shooter will feature a first person state like MGS so maybe that will be a good start in implementing it.
    Good luck
     
  45. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Thanks for your purchase @andrewpstern!
    Hmm I guess one way is using waypoints to make them go exactly to the transform indicated.

    Hey @Kiwi-Hawk, the link you posted isn't loading but just make sure that the FBX model are set up as Humanoid and not generic or legacy. Indeed our template require a least the basic knowlegde of Unity, components, mecanim and scripting. But everything is very organized and you can learn a lot by just reading the comments and our documentation. I also recommend you to watch some video tutorials about mecanim, I posted one very good a few posts above about how set up humanoid models by Unity.

    If your capsule collider was in the wrong place, perhaps your character model has a wrong root transform, the correct is always on the characters foot, centered.

    And about the First Person view our controller really focus on ThirdPerson, you can set up the zoom to 0 but the camera will pass through the character or you can enable our CullingFade making the character fade.

    @jayimagination I guess to get a decent transition of 3rd person to 1st person you will need to use First Person animations, but it's not so simples to make it, this will require another controller, camera, animations and a lot of more code. I will try study a way to use the same animations, if I get some nice results I will share with you guys.
     
    jayimagination likes this.
  46. jayimagination

    jayimagination

    Joined:
    Dec 20, 2012
    Posts:
    89
    Thanks that would be fantastic!
     
  47. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Here is a preview of the V-Mansion for you guys :D

     
    jayimagination likes this.
  48. Kiwi-Hawk

    Kiwi-Hawk

    Joined:
    Jul 17, 2015
    Posts:
    288
    Kia ora

    Thank you for a great product BTW it ahs made getting a third person char into a scene much easyer and much much more flowent to use. next step try get Eva in with ALL her animations.

    I rigged on Mixamos site I think maybe I didn't click the option for root transform, It's weird the link broke
    https://www.assetstore.unity3d.com/en/#!/content/46366 it was really for you to see just what was on the Char, I'm guessing if I select import all animations check box, all the animation on the char will be added to the char in Unity. Was after that mainly cause he has a script on that char for taking off/changing the armours and weapons. Videos seem to be the best way for me to learn now, as you see as a great looking young man I have trouble retaining what I read. to many failing cluster between the ears, but I'm not giving up, if I go over it enough it reash's into long term memory and somethimes staysif I doit enough

    BTW that V-Masion video is choice, it places like that where a lot of player like to pop to first person for rpg games they play that char. Viewing the world in all it's glory from thrid person while traveling outside and poping to first person going into building or interacting with NPC's (No Player Characters) was the reason behind my ask about it.


    Again kudos for a great job, belated seasons greeting to BTW

    Edit: save making a second post

    Should I be conserned about this error

    Default bone found in the file is different from the one found in source avatar:

    Bip02 Spine'; postion error = 23.402756

    Clip 'Take 001' has import animation warnings that might lower retargeting quality

    'Bip02 Spine' has translation animation that will be discarded.

    It's at the bottom of each animation, is that why theyer not importing?
     
    Last edited: Jan 4, 2016
  49. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I got some of this warnings too, nothing to worry about if your animation clips is playing correctly with no weird bone rotation or something like that, this is just some minor offsets that the animation clip has comparing to the original avatar.
     
  50. Kiwi-Hawk

    Kiwi-Hawk

    Joined:
    Jul 17, 2015
    Posts:
    288
    Kia ora

    Ok I got the char in game a running about I now have to find out how to fix the drop jaw, and mouth locked open
    in a weird look. I vaguely remember a Unity tutorial for third person using the Challanger had the same issue but sadly he didn't show how he fixed it