Search Unity

  1. Unity 2019.2 is now released.
    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. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    There isn't anything on the actual character controller that signifies the item is in use. To specifically get this you'll have to loop through the equipped items from the inventory and cast the weapon to an IUsableItem. From there you can check the InUse method to determine if the weapon is being used.
     
  2. EdBoon

    EdBoon

    Joined:
    Nov 24, 2014
    Posts:
    99
    Where do i find/disable the aim assist (found it, camera) and red cursor over enemies?
    ---
    sweet, checking IUseableItem inUse worked. thanks.
     
    Last edited: Aug 30, 2018
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    Take a look at the CrosshairsMonitor - this allows you to set the target color.
     
  4. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    276
    oh snap, the ultimate character controller is out on opsive sight? sweet god how long till its on the asset store? I literally don't want to sleep now.
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
  6. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,658
    @opsive I'm using the Character Builder on a Morph 3D character in Unity 2018.2, but the character does not get the Items hierarchy when built. I have the Morph3D integration imported, but it still doesn't work. For now I just manually created them in the correct point in the hierarchy. There didn't seem to be any instructions and the integration only adds the Morph 3D define to the settings so I don't see what could be wrong. I checked and the MORPH_CHARACTER_SYSTEM_PRESENT is definitely in the scripting define symbols. I also made sure I had source code version just in case.
     
  7. LironIL

    LironIL

    Joined:
    Jan 28, 2017
    Posts:
    4
    what to do?



    edit:
    its only when i select "is networked" in the character builder,
    is it important if i what multiplayer game?
     
    Last edited: Sep 10, 2018
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    That symbol really only tells ItemBuilder to look for a Morph3D Component so it knows where to place the items. It sounds like Morph3D changed their system recently - I'll take a look.
     
    magique likes this.
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    I've answered you on the opsive forum :)
     
  10. LironIL

    LironIL

    Joined:
    Jan 28, 2017
    Posts:
    4
    thank you ☺
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,658
    @opsive I'm seeing this error when stopping play mode in the editor. I know this has been there for a while, but I don't remember if there is a fix for it.

    Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)
    The following scene GameObjects were found:
    Scheduler


    It might be some other asset, but I was getting it until I added TPC to the scene so I think there must be a relationship.
     
    Last edited: Sep 11, 2018
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    That will occur if you haven't first added the scheduler to a persistent GameObject. Make sure you run scene setup so it'll add the scheduler:

    http://legacy.opsive.com/assets/ThirdPersonController/videos.php?id=1
     
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,658
    Sorry about that. Yeah, I forgot to do the scene setup. My fault.
     
  14. russnash37

    russnash37

    Joined:
    Feb 22, 2017
    Posts:
    27
    We are using Third Person Controller with DevDogs Inventory Pro via your own integration system. All is working great except for one thing:

    When starting our game from a saved game, my code reloads the respective Inventory Pro inventories from the persisted save files and, for example, places an axe back into the 'hands' slot that will normally activate the axe as an in-hand weapon when dragged there by the player, however, when the load routine places the axe there (using collection.AddItem from Inventory Pro) the axe appears in the correct collection slot, however, TPC does not 'activate' it so that it appears in the characters actual hand ready for use.

    I'm guessing that maybe, in these particular cases, I need to call a routine or fire an event to let TPC know that the axe (or other weapon) should be 'activated' and appear in the TPC characters hand.

    Can you please offer any advice?

    Thanks in advance,

    Russ.
     
  15. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    I would set a breakpoint within PrimaryTPCItem.NotifyItemEquipped - Inventory Pro should be calling this method when the item has been equipped.
     
  16. russnash37

    russnash37

    Joined:
    Feb 22, 2017
    Posts:
    27
    I set a breakpoint as advised, didn't see any errors within the NotifyItemEquipped function, however, I did then receive a NullReferenceException within Item.cs:



    Could this be related?
     
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    It probably is related. If you're getting that error then the item isn't positioned correctly in the hierarchy. Did you use the Item Builder to create it? The Item Builder will correctly place it in the hierarchy.
     
  18. N-Orbit_Studios

    N-Orbit_Studios

    Joined:
    Nov 21, 2016
    Posts:
    50
    @opsive I am working with russnash37 on this project and I was the one that set the axe up, I used the Item Builder , but some things still did not work, so I referred to the sample scene till I got it working. The item is placed in Items on the right hand below the right hand thumb. The weapon equips good and can be used.
     
  19. Roy927

    Roy927

    Joined:
    Sep 22, 2018
    Posts:
    7
    Is it possible to change the Animator Controller base state on runtime? I want to switch it to injured movement when health is lower.
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    Roy927 likes this.
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
  22. Roy927

    Roy927

    Joined:
    Sep 22, 2018
    Posts:
    7
    Having spend hours on end to get a gun to reload I decided to re-import the whole asset and then it started to work again. o_O
    It's really weird sometimes when Unity doesn't really tell what, and if it is going wrong with the asset.
     
  23. P3D

    P3D

    Joined:
    Mar 5, 2015
    Posts:
    3
    Upon deleting a character with a Dialogue System interaction bridge on it:


    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.Transform.InverseTransformPoint (Vector3 position) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/TransformBindings.gen.cs:404)
    Opsive.ThirdPersonController.Interactable.CanInteract () (at Assets/Third Person Controller/Scripts/Traits/Interactable.cs:107)
    Opsive.ThirdPersonController.Abilities.Interact.CanStartAbility () (at Assets/Third Person Controller/Scripts/Character/Abilities/Interact.cs:54)
    Opsive.ThirdPersonController.Abilities.Ability.UpdateAbility () (at Assets/Third Person Controller/Scripts/Character/Abilities/Ability.cs:135)
    Opsive.ThirdPersonController.RigidbodyCharacterController.Move (Single horizontalMovement, Single forwardMovement, Quaternion lookRotation) (at Assets/Third Person Controller/Scripts/Character/RigidbodyCharacterController.cs:379)
    Opsive.ThirdPersonController.ControllerHandler.FixedUpdate () (at Assets/Third Person Controller/Scripts/Character/ControllerHandler.cs:284)
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,792
    Hi @P3D - Are you talking about a DialogueSystemInteractableTarget component or a DialogueSystemThirdPersonControllerBridge component?

    Are you deleting the character during a conversation?

    What versions of TPC and the Dialogue System for Unity are you using?
     
  25. P3D

    P3D

    Joined:
    Mar 5, 2015
    Posts:
    3
    Unity 2017.4.12
    TPC 1.3.11
    Dialogue System 2.0.4
    Dialogue System Integration package from: https://legacy.opsive.com/assets/ThirdPersonController/integrations.php

    Just run the integration example scene and try deleting one of the "Interaction" gameObjects runtime our deleting the character that hold it. The error occurs.
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,792
    Thanks for the info. I'm contacting Opsive.
     
    opsive and P3D like this.
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    To fix this open Interactable.cs and change line 89 from:
    Code (csharp):
    1.  
    2. if (m_Interactor == null || !m_InteractableTarget.IsInteractionReady()) {
    3.  
    to:
    Code (csharp):
    1.  
    2. if (m_Interactor == null || !m_InteractableTarget.IsInteractionReady() || m_Transform == null) {
    3.  
     
    P3D and TonyLi like this.
  28. P3D

    P3D

    Joined:
    Mar 5, 2015
    Posts:
    3
    Works flawlessly.
     
  29. davebutlerenator2

    davebutlerenator2

    Joined:
    Nov 8, 2014
    Posts:
    26
    Hi - I purchased the third person animation controller for a multiplayer swordfighting project I'm working on (love the feel of the controller btw).

    I have the controller on the player object, as well as on all the AI fighters. I'm hitting performance issues due to when I increase the number of AIs in the scene (right now I'm around 30 but I would like to be able to have 100+).

    Is this to be expected? If so, do you have a recommendation for a simpler more performant third person controller I can put on my AIs (I'd like to keep TPC on the player since it feels so nice). If not, do you have any recommendations for increasing performance?

    Thanks!
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    Glad you are enjoying the controller! Are you using version 1 or 2? Also, have you tried profiling to see what the bottleneck is?
     
  31. davebutlerenator2

    davebutlerenator2

    Joined:
    Nov 8, 2014
    Posts:
    26
    Version 2

    I have tried profiling, the bottleneck is in DeterministicObjectManager::FixedUpdate where everything is moved, and the biggest culprit with in that is CharacterLocomotion::CheckGround
     
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    For version 2 support can you post on the opsive forum? This allows me to track support requests better. Also post as much detail about what your profiler looks like.
     
  33. davebutlerenator2

    davebutlerenator2

    Joined:
    Nov 8, 2014
    Posts:
    26
  34. Jokul_TX

    Jokul_TX

    Joined:
    Oct 30, 2017
    Posts:
    4
    Was wondering if this controller could easily be configured to a tab target MMO setting. Third person view with complete movement on the mouse. Right button pressed to move camera around, left button pushed to follow camera view. I read through the configurations on your website and couldnt quite figure out if one of the Adventure settings did this particular setup. Thanks in advance!
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    This thread is for version 1 of the Third Person Controller which is no longer on the Asset Store but version 2 is (version 2 thread).

    To answer your question though, there is a RPG movement type which has a standard RPG control scheme. With this movement type the left mouse button will rotate the camera and the right mouse button will rotate the character. It sounds similar to the setup that you are going for so with a bit of button mapping and maybe some minor script changes you'd be able to get it working.
     
  36. Cassos

    Cassos

    Joined:
    May 20, 2018
    Posts:
    14
    Great stuff! Iam from the Invector guys far away from this kingdom :D
    Many things are made way better but the thing with the inventory. Is there a way to add one with armor slots etc. without a huge investment of time?
     
    mattis89 likes this.
  37. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,070
    Yea! That would be cool! Maybe a type of survivor inventory
     
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,704
    Are you working with version 1 or 2? Version 1 is no longer supported and the version 2 thread is here. Version 2 contains a basic inventory that is designed to be extended since inventories are a major asset on their own and the focus of version 2 is on the character controller side of things :)
     
Thread Status:
Not open for further replies.