Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Third Person Controller - Third Person, AI, Multiplayer, Mobile Framework

Discussion in 'Assets and Asset Store' started by opsive, Jan 21, 2015.

Thread Status:
Not open for further replies.
  1. xercool

    xercool

    Joined:
    Sep 5, 2017
    Posts:
    90
    Hi, @opsive.

    I have a couple of questions.

    1) Can I use UI element as indicator instead Splite element? I have Canvas with uGUI elements and trigger UI element. I'd like connect it with "Interact" ability (show on raycast trigger)

    2) I use new UMA 2.7 and RigidBodyController and found issue with Animation controller. When I set third person controller as animation controller my character's mouth is open :D I don't know why and what causes that problem. Maybe u have any ideas how to solve this?
     
  2. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151

    Im using the adventure but I figured that its possible to change the animation clip for "crawl" in this case... or add crouch to the adventure controller..?

    EDIT: I figured it out Justin... It´s just to go and copy everything, so I have set my whole character up with mixed abilities from different controllers :) Awesome! By the way, is it okay to use the horse in commercial use?
     
    Last edited: Dec 13, 2017
  3. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    473
    Yes, that was it. Thanks!

    Now that Ethan is moving more realistically, I noticed that his boot sometimes gets inside the terrain. Any suggestions for fixing that?

    ethan_boot_terrain.PNG
     
  4. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135

    The complete error is

    NullReferenceException: Object reference not set to an instance of an object
    Opsive.ThirdPersonController.ObjectPool.InstantiateInternal (UnityEngine.GameObject original, Vector3 position, Quaternion rotation, UnityEngine.Transform parent, Boolean networkSpawn) (at Assets/Third Person Controller/Scripts/Game/ObjectPool.cs:179)
    Opsive.ThirdPersonController.ObjectPool.Instantiate (UnityEngine.GameObject original, Vector3 position, Quaternion rotation, UnityEngine.Transform parent) (at Assets/Third Person Controller/Scripts/Game/ObjectPool.cs:152)
    Opsive.ThirdPersonController.ObjectPool.Instantiate (UnityEngine.GameObject original, Vector3 position, Quaternion rotation) (at Assets/Third Person Controller/Scripts/Game/ObjectPool.cs:127)
    Opsive.ThirdPersonController.Health.DieLocal (Vector3 position, Vector3 force, UnityEngine.GameObject attacker) (at Assets/Third Person Controller/Scripts/Traits/Health.cs:390)
    Opsive.ThirdPersonController.Health.Die (Vector3 position, Vector3 force, UnityEngine.GameObject attacker) (at Assets/Third Person Controller/Scripts/Traits/Health.cs:356)
    Opsive.ThirdPersonController.Health.DamageLocal (Single amount, Vector3 position, Vector3 force, Single radius, UnityEngine.GameObject attacker, UnityEngine.GameObject hitGameObject) (at Assets/Third Person Controller/Scripts/Traits/Health.cs:312)
    Opsive.ThirdPersonController.Health.Damage (Single amount, Vector3 position, Vector3 force, Single radius, UnityEngine.GameObject attacker, UnityEngine.GameObject hitGameObject) (at Assets/Third Person Controller/Scripts/Traits/Health.cs:240)
    Opsive.ThirdPersonController.CharacterHealth.Damage (Single amount, Vector3 position, Vector3 force, Single radius, UnityEngine.GameObject attacker, UnityEngine.GameObject hitGameObject) (at Assets/Third Person Controller/Scripts/Character/CharacterHealth.cs:74)
    Opsive.ThirdPersonController.Health.Damage (Single amount, Vector3 position, Vector3 force) (at Assets/Third Person Controller/Scripts/Traits/Health.cs:163)
    Opsive.ThirdPersonController.CharacterHealth.OnCharacterLand (Single fallHeight) (at Assets/Third Person Controller/Scripts/Character/CharacterHealth.cs:100)
    Opsive.ThirdPersonController.EventHandler.ExecuteEvent[Single] (System.Object obj, System.String eventName, Single arg1) (at Assets/Third Person Controller/Scripts/Utility/EventHandler.cs:322)
    Opsive.ThirdPersonController.RigidbodyCharacterController.CheckGround () (at Assets/Third Person Controller/Scripts/Character/RigidbodyCharacterController.cs:488)
    Opsive.ThirdPersonController.RigidbodyCharacterController.Move (Single horizontalMovement, Single forwardMovement, Quaternion lookRotation) (at Assets/Third Person Controller/Scripts/Character/RigidbodyCharacterController.cs:398)
    Opsive.ThirdPersonController.ControllerHandler.FixedUpdate () (at Assets/Third Person Controller/Scripts/Character/ControllerHandler.cs:284)


    It appeared at some point (it is not related to the update, since it appeared a few days before going to the latest version) I would like to know what elements should look to fix it. I do not think it's a bug. It is precisely when the player dies for an action that I use Playmaker.
     
    Last edited: Dec 14, 2017
  5. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Download and reimport without deleting everything I have set up? :)
     
  6. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    There is a whole lot of options on the IK component to tweak, try that... its only settings...
     
  7. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151

    I use the adventure.. But I figured everything out now :) I have like the most amazing adventure combat character ever made, he can do it all :D

    Still this coop issue to fix without rewired asset.....hmm..
     
    opsive likes this.
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    The AnimatorMonitor only uses a sprite so for that it'll require extending this class.
    This relates to the avatar mask - make sure you have the jaw bone disabled:

    https://unity3d.com/learn/tutorials/topics/animation/avatar-masks
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Definitely :)
     
    mattis89 likes this.
  10. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Looks like you have a null object under the Spawned Objects On Death foldout of the Character Health component.
     
    gferrari likes this.
  11. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I want to thank you because you always answer all the questions very quickly! It was exactly that and I was able to solve it.
     
    opsive likes this.
  12. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    hmm..Does the hang work like this -

    If the hang layer is climb, and I jump against the layer, and it´s start type to automatic , my character grabs it ? No need for the input because he automatic should grab if he almost dies? :D
    works like balance?


    AND, When I make a Meeele, what should I put like "bullets" when I first create the Item type?.. Because I only want the "Sword" and it dosent need anything else..
     
    Last edited: Dec 14, 2017
  13. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151

    About this UI, do I have to somehow make a duplicate of the UI or ? I was just thinking when the screen is split, so the characters can have each UI and inventory wheel?
     
  14. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    473
    Great. Do you mean one of these?

    - Foot Position Adjustment Speed
    - Foot Rotation Adjustment Speed
    - Foot Weight Adjustment Speed
     
  15. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    yes... I would start with small numbers, and try.. I havent use that.. I use Final IK
     
  16. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    473
    I recently bought Final IK, but have not used it yet. Do you recommend removing the IK component and switching to Final IK?
     
  17. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    It depends what you are after. OTpc's IK script is well written and works good...cant complain :D

    But with FIK you get alot of other functions as well. And their grounderFBIK is easy to use and you can achieve flawless body IK .. And the best part is that its intergrated with otpc , takes a minute to set up :)
     
    username132323232 likes this.
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    That's correct :)
    You don't need a consumable item type for melee weapons. In this video I setup the katana which you can use as a model:

    http://opsive.com/assets/ThirdPersonController/videos.php?id=11
    Yes, you'll want to duplicate the UI for each split screen segment. From there you can specify which character the UI monitor components should use.
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Thanks @mattis89 :)

    I also recommend it especially if you already have it. Unity's IK system doesn't give nearly as much control as what FinalIK does. You also just have to swap out the CharacterIK component with the FinalIKBridge component so it's an extremely easy setup (once you have FinalIK configured).
     
    mattis89 and username132323232 like this.
  20. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    473
    Thanks @mattis89 and Justin. Great advice and almost real-time too :)
     
  21. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    473
    I would like Ethan to start walking slowly, get to running speed in the middle of the path and then slow down again. I'm assuming that it can be done with Speed Change ability and BD "Start Ability" task.

    Questions:
    1) Since I'm using root motion, will Speed Change Multiplier in Speed Change ability be ignored?

    2) Where does the actual speed or speed multiplier go in BD "Start Ability" task? Or is it supposed to be controlled from somewhere else?
     
  22. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    The player in some corners is left running forever. Is there any way to avoid that bug?

    upload_2017-12-15_2-55-26.png
     
  23. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Its not a bug I think. What movement are you using? There are settings on how you want the character to face when you move.. Im at work so cant give any more details.
     
    gferrari likes this.
  24. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Yes I realised that , just left it blank.. I got it setup nicely, changed the katana animations to sword and added the spin and used the recoil, really nice :) is the magic similar to make? Like cast a fireball, same setup? I ment to use realistic effects 4.

    Okay, about the split screen, how do I change the canvas UI to be on the bottom screen ? Im not really familiar with the positioning and UI overall..
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    No, if you have running animations within the movement blend tree it'll then use those so root motion will be applied.
    Can you add more details to this? I'm not completely following.
     
  26. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Yes, similar setup with the item builder :)

    Take a look at this page for a good overview on how the UI system works:

    https://unity3d.com/learn/tutorials/topics/user-interface-ui/ui-canvas?playlist=17111
     
    mattis89 likes this.
  27. XOA_Productions

    XOA_Productions

    Joined:
    Nov 27, 2016
    Posts:
    24
    Thank you for your reply, I think I'd have searched for hours without you!
    This almost fixed it, exept for some small issues. CrossfadeInFixedTime takes a fixedTransitionDuration instead of a normalizedTransitionDuration, so changing it to the following worked in my case:
    Code (CSharp):
    1.  m_Animator.CrossFadeInFixedTime(stateHash, normalizedDuration * m_Animator.GetCurrentAnimatorStateInfo(layer).length, layer, normalizedTime);
    Awesome and fast support from you guys!
     
    opsive likes this.
  28. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Thank you! That is my setting

    upload_2017-12-15_11-13-40.png
     
  29. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hmm, cant really see something out of the ordinary.. Try make a video of whats happening.. and does it allways happen?
     
    gferrari likes this.
  30. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Whats the right way of making fist? .. Since fist have no base object and since the hand have no rigidbody, should I use a sphere that I later make invisible?

    Seems to work?

    I made it one the left hand because my character have a demon hand so, he uses his claws...

    anyhow, I get a error "Error: Unable to transition to Left Hand.Fist.Movement because the state doesn't exist." What have I missed now ? When I walk I get the error...and if i try to hit when I walk, he lifts his arms up like he is aiming, and when I stops he attacks...?

    Edit: I fixed that error.. Got a new one tough, "Error: Unable to transition to Base Layer.Fist.Attack left because the state doesn't exist. and " Error: Unable to transition to Upper Layer.Fist.Attack left because the state doesn't exist." but they do... he attacks!?

    Edit: The error occurs when I try to attack when I walk... I guess its just som layering...hmm..


    Edit: I have set up the fist same as "dom" still error when I walk and try to Attack..Its set to "Upper Body"

    EDIT!!!!!

    LOL! Sometimes I want to slap myself in the face...I didnt have left with uppercase...lol... This is the results of working at a standing position job 7 days a week 8 hours straight! :D

    Sorry for spamm! :D
     
    Last edited: Dec 15, 2017
  31. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Does anyone here have a networked integration scene of ICE and TPC that's working.

    Im having a heck of a time getting the two of them to function under the Unity Network protocol from TPC. Ive started with the base network scene but Im getting unreliable results as I set the player object and the ICE creature registry. The damage integration is working - but the Ai acts wonky.. Is it required to have the source code installed to run the networked version of TPC?
     
  32. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Question tough; Did you setup the input in the TPC Start window? =)
     
  33. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Yes, it is configured, I think it is an error of my game, not the third-party controller. Probably some of the ability to change speed and he can't stop. It does not happen often, but sometimes the character stucked in the corner with the running state looping.
     
  34. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151

    aah..what unity verision? latest 5.6 is very stable =)
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Awesome - I'll make that change as well. If I notice any problems I'll post the fix!
     
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    It's tough to tell what is going on from the screenshot so if you can do a video or even better if you can reproduce it in the clean scene that would be great.
     
    gferrari likes this.
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Yes - if you use an empty GameObject with sphere colliders then that works great for the fist.
     
    mattis89 likes this.
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    I haven't used ICE and the TPC integration was created by the ICE developer so I'm not sure I'll be too helpful, but you do need to have the source imported in order for networking to work. Take a look at this page for the steps required:

    http://opsive.com/assets/ThirdPersonController/documentation.php?id=76
     
  39. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Did an AI system come with TPC? I tried to make an agent in the character builder wich is generic (I downloaded it from asset store, it was legacy so all animations was inside of the character) it didnt work tough, it didnt find a controller.. whats the steps? Is there docs? Didnt find them neither :D
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    There isn't any AI included. The AI checkbox will not add the Unity Input component so it can be used with AI. Behavior Designer is integrated with TPC and there's a pretty large behavior tree described at http://opsive.com/assets/BehaviorDesigner/documentation.php?id=119
     
  41. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I was able to capture the video of the error, it happens to me when I'm running to a corner. It does not always happen. What could generate such behavior?

    Those rocks are "climb" layer, will it have any relationship?

     
    Last edited: Dec 16, 2017
  42. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hmm, maybe cover layer is set?

    EDIT: Is the climb state set to automatic or button down?
     
    Last edited: Dec 16, 2017
  43. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
  44. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Is there any tutorial somewhere on the intergration between inventory pro and TPC? :)
     
  45. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    hi, why i have this on profiler ? there is no error fixed update problem in profiler.png
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Hmm.. I don't know what that would be. Can you send me a repro project so I can take a closer look?
     
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    mattis89 likes this.
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,093
    Based off of that screenshot DirectorFixedUpdatePostPhysics is taking 43% of the time which I think is related to Timeline. You'll have to expand each element more in order to find out specifically what it is.
     
  49. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I will try to send something if I could. Look, this error happens when I have this kind of bug and then I press stop the play mode. I think is related.

    How I said, my bug is when the player try to run and short-climb at the same time. (Not always I get the bug)

    MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Component.GetComponentsInChildren[Collider] (Boolean includeInactive) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ComponentBindings.gen.cs:99)
    UnityEngine.Component.GetComponentsInChildren[Collider] () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ComponentBindings.gen.cs:109)
    Opsive.ThirdPersonController.Abilities.ShortClimb.AbilityStopped () (at Assets/Third Person Controller/Scripts/Character/Abilities/ShortClimb.cs:351)
    Opsive.ThirdPersonController.Abilities.Ability.StopAbility (Boolean force) (at Assets/Third Person Controller/Scripts/Character/Abilities/Ability.cs:249)
    Opsive.ThirdPersonController.Abilities.Ability.StopAbility () (at Assets/Third Person Controller/Scripts/Character/Abilities/Ability.cs:233)
    Opsive.ThirdPersonController.Abilities.Ability.OnDisable () (at Assets/Third Person Controller/Scripts/Character/Abilities/Ability.cs:109)



    upload_2017-12-17_1-53-52.png
     
  50. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hmm okay. Dont destroy it :D I dont know..Im gonna play around with the short climb / climb and hang today so Im gonna check it out if I get the "bug" too.. I can post my settings when I have it the way I want.
     
    gferrari likes this.
Thread Status:
Not open for further replies.