Search Unity

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. bmccall1

    bmccall1

    Joined:
    Jul 28, 2013
    Posts:
    120
    Has anyone rigged this up to Photon or any other networking?

    We hare having a hard time getting the arm animations to synch up.
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I have heard of people attempting it though I don't know the results. This doesn't help right now but version 2 will support Photon PUN, right now I have the locomotion aspect working and will be working on animation next week. I can let you know of any tips that I learn while implementing it if it helps with v1. Photon has an animator component which will sync the animations so I was going to try that first.
     
  3. mmvlad

    mmvlad

    Joined:
    Dec 31, 2014
    Posts:
    98
    Hi,
    great asset. One question - how can I prevent character from looking at target when shooting? It always looks at the target position now which I don't want.

    thank you
     
  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Glad you're enjoying it! This sounds like it's IK related so you can set the head weight to 0 on the CharacterIK component.
     
  5. jimburn

    jimburn

    Joined:
    Apr 1, 2017
    Posts:
    64
    There is a problem with Unity 2017, they use a new Input component and TPC does not work. Do you have a quick fix for that?
     
  6. mmvlad

    mmvlad

    Joined:
    Dec 31, 2014
    Posts:
    98
    Thanks. I did it but it didn't fix the problem. I may have described the problem not correctly - the problem is "auto aim". When i press shoot it aims automatically to center of object.

    And when in aim mode - character locks target. I also don't want this.
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I've used it with 2017.1 and am not aware of any issues. Are you talking about this new input system? It's still in experimental mode so TPC doesn't support it yet.

    If you are using a controller with your game I highly recommend Rewired as it'll handle this input mapping for you. Unity's current input system is getting pretty dated.
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Ah, this is related to target locking. You can disable it within the camera state.
     
  9. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Agreed.

    Do you have any updates planned for TPC or is most of your work going into TPC2?
     
  10. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    We are fixing any version 1 bugs and ensuring it works with the latest Unity release, but besides that most of the development is going into v2. If something from v2 can easily be backported to v1 we'll do that, but at this point we're still trying to get v2 'on par' with v1. Version 2 is going extremely well though - we've gotten a lot of positive feedback from the alpha testers. We should hit the beta stage in a couple of months.
     
  11. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    That sounds great that you can spend most of your time on v2. Looking forward to the v2 release.
     
  12. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Is ultimate fps v2 going to be a free upgrade?
     
  13. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I'm really liking how well v2 is shaping up to be. We probably could have released v2 by now had we not chose to go the custom character controller route, but this adds a ton of flexibility so it should be worth it in the long run. We'll be releasing a lot more info as soon as we start the beta!

    We haven't announced anything yet regarding the pricing structure of upgrades. We'll have more info after we begin beta and have a better idea of exactly what is included.
     
  14. ElBuho

    ElBuho

    Joined:
    Mar 9, 2015
    Posts:
    32
    Hello @opsive

    I have two questions:
    1.- When Opsive acquired UFPS announced a future integration between UFPS and TPC. This v2 includes that integration or will it come in a future version?
    2.- Do you have a release date for version 2?

    Thanks in advance.
     
  15. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Version 2 includes this integration :)
    Nothing concrete yet. We are aiming for later this year but is still tough to judge exactly when. We have so far ran 3 alphas and have gotten really great feedback - our goal is to start the betas within a couple of months.
     
  16. ElBuho

    ElBuho

    Joined:
    Mar 9, 2015
    Posts:
    32
    What great news!

    So, In the end there will only be one asset? Is like a merge of both with all the features?

    Thank you again.
     
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    There will still be two different assets. UFPS will only contain a first person view and TPC will only contain a third person view. They will share a huge amount of code/components though so you'll be able to seamlessly switch between perspectives if you have both assets.
     
  18. ElBuho

    ElBuho

    Joined:
    Mar 9, 2015
    Posts:
    32
    And the current possibility of switching between first and third person with only one asset will disappear? I mean, this only will happen if you have both assests, or will there still be such a possibility in version 2 like in version 1?

    Thanks again for answering all my questions.
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    No problem!

    UFPS v1 has a third person view but it leaves a lot to be desired. The third person view from UFPS will be removed from v2 and require TPC if you want to have a third person view. TPC has never officially had a first person view, though a community member did create a mod for it. You will only be able to switch perspectives if you have both assets.
     
    ElBuho likes this.
  20. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Hi! I want to know if I could play some animation from the animator (like Pick Up item) with playmaker or Adventure creator. I want to make it but when I use Animator Play with playmaker and it don't work, I want to have the control of the animations in the player. Thank you!
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Yes - you'll want to start an ability to play the animation (such as the Item Pickup ability). With Playmaker there is a StartAbility action and you could create something similar for Adventure Creator.
     
    gferrari likes this.
  22. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Thank you for reply all my questions. I don't have "StartAbility" in my Actions Maybe I'm in the wrong section. Thanks again
     

    Attached Files:

  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I posted it on the opsive forum but forgot to upload it to the integrations page - when you download the latest you should have it :)
     
    gferrari likes this.
  24. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    @justin Are there any other actions included with this integration? For example, equipping weapons, increase/decrease current health?
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Here's the set of actions included:

    actions.PNG

    There are more community actions from this post: http://opsive.com/forum/index.php/topic,4588.0.html
     
    Deckard_89 likes this.
  26. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Thanks!! I have this problem (image attached).. :(
     

    Attached Files:

  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Make sure you use the full path to the ability for the name, such as Opsive.ThirdPersonController.Abilities.PickupItem.
     
  28. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I put the full path, I don't have error now, but the character don't want make the animation. I use a Adventure creator Item. I think I'm tired today. Maybe tomorrow I have more ideas... Thanks
     
  29. ElBuho

    ElBuho

    Joined:
    Mar 9, 2015
    Posts:
    32
    Thank you for all the information.
    For me it's difficult to choose one of these two assets, both have awesome features. I'll think about it a little more; but I definitely want to try one of the two.
    Thank you again.
     
    opsive likes this.
  30. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Justin,

    I'm using the EventHandler class in a separate project because it seems like a really nice event solution. I have a few basic questions about it's use.

    1. What is the difference between using a global event where I do not need a gameobject to pass and an event where I do need to pass the gameobject? It seems to me, if I am executing that event somewhere else in my game and I want to stay decoupled from the object that registered the event, wouldn't it be better to use a global event? I ask because after digging through your code for Third Person Controller, I couldn't find a single example where you used a global event. In every case, you pass the gameobject that owns the event and thus on the objects that execute the event, you are required to grab a reference to the gameobject that registered the event......which seems to defeat the whole point of staying decoupled.

    2. As an example, my player has weapon props which have weapon trails on them. I need to turn on the weapon trails when my player starts an attack animation and then turn them off when the attack animation is complete. In order for my prop weapons to remain decoupled as objects from my player, wouldn't it be better to not pass the payer object into the event? If I pass the player object into the event when I register it, then that means I will have to get a reference to the player gameobject on my prop before I execute the event so that the Execute event has the object that the event is attached to. And if I have already gone through the trouble of finding the player gameobject in my prop class, then I don't really need an event. I can just reference whatever I need on the player gameobject.

    What really messes with my brain isn't so much dealing with the player gameobject which is always in my scene but enemies who I have pooled and am spawning and despawning. I want the enemies to know what the player is doing without having to get a reference to the player every time I spawn an enemy so global events almost always seem to make more sense.

    I appreciate your thoughts on this.

    Thanks
    Allan
     
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    There are a few events which use the global event system:

    OnCameraAttachCharacter, OnNetworkServerReady, OnNetworkAddFirstPlayer, OnNetworkStopClient

    These events are more meant to be global game state rather than tied to a specific player.

    You could pass the player object as a parameter to the global event system and then have the receiving action determine if that event belongs to the character, but I personally would use the local version so you don't have to do the filtering. In this specific case you could explicitly call the method to add the weapon trails but it starts to really become useful when you have multiple things that should happen with a single event.
     
  32. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Thanks for the quick reply. I guess I need to do some more research on events.

    I still don't understand the point of trying to decouple stuff if when you execute the event you are required to find a reference to the object that registered the event before you even execute the event. (or visa versa) It just seems to defeat the whole point. :)
     
    Last edited: Jul 31, 2017
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    In the case of adding weapon trails there probably isn't any benefit towards using the local version rather than the global version. Chances are you'd pass in the starting position/rotation and then start adding the effect there. The real benefit comes when a local component is interested in the event.

    Lets take applying damage as an example. You may have a separate component on each player that keeps the stats for that player. If you used the global event then you'd have to pass in the player that the damage is applied to so the local component can ensure it is being applied to the correct player. With a local event you can just execute the event and when the local component receives the event it knows that the damage event applies to the current player. In this case you don't want to have the health component aware of the stat component since it doesn't require it.
     
  34. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Ok I think we may be mis-communicating or I'm just unclear on the nomenclature of local vs global when referring to events.

    In Evenhandler.cs, referring to the comments on the various method overrides, any event that does not pass a gameobject is considered global and any event that passes a gameobject when it is registered and executed is local.

    So I was assuming a global event is simply an event where you do not need the gameobject and a local event is where you need to both define the owning gameobject when executing and define the gameobject when registering and those gameobjects need to be the same.

    So I think from your example, you're saying that by passing the gameobject in an event, this requires the class where you register the event to also have a reference to that same gameobject that executed the event and thus the event will only fire if you have that reference.

    Allan
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    You don't have to reference the same GameObject that the component is attached to but the rest is correct.
     
  36. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Hi!, Please, I need to solve it to release a demo, I'm using it with Adventure Creator (and the integration of Third peson Controller) It work perfectly, but just dont show the character correctly when I save and load the game. That is the problem:

    ---------
    MissingReferenceException: The object of type 'AdventureCreatorControllerHandler' 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.
    Opsive.ThirdPersonController.ControllerHandler.SceneLoaded () (at D:/Justin/Documents/Opsive/Assets/Third Person Controller/Assets/Third Person Controller/Scripts/Character/ControllerHandler.cs:575)
    Opsive.ThirdPersonController.ControllerHandler.OnSceneLoaded (Scene scene, LoadSceneMode mode) (at D:/Justin/Documents/Opsive/Assets/Third Person Controller/Assets/Third Person Controller/Scripts/Character/ControllerHandler.cs:566)
    UnityEngine.SceneManagement.SceneManager.Internal_SceneLoaded (Scene scene, LoadSceneMode mode) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/SceneManagerBindings.gen.cs:245)
    ----------

    The strange thing is if you walk or run the character in some time appear, but is not acceptable for a correct gameplay. Thank you!
     

    Attached Files:

  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Are you running the latest version? I remember fixing a related issue in the latest version - go ahead and give the source another download to see if that helps at all. ControllerHandler.OnDestroy should have:

    Code (csharp):
    1.  
    2.             SceneManager.sceneLoaded -= OnSceneLoaded;
    3.  
    So OnSceneLoaded will not be called with the old reference when a new scene is loaded.
     
    gferrari likes this.
  38. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @gferrari - yes, once you import it you should be good to go and not need to make any modifications.
     
  40. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I import the source code and the error is gone (thank you) but the character still doesn't correctly when I save and load the game like the screen capture I upload before... is very strange behavior because when you walk or run the character in some time appear...

    I think is a camera issue...
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Do you have the character fading out with the camera? That's the only part of the Third Person Controller which modifies the material opacity and I'm wondering if that is it. A good test would be to disable the fade on the camera state.
     
    gferrari likes this.
  42. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I resolve the issue uncheking "Always reload scene when loading a save file" in the Adventure Creator Setting, I don't know why, but it worked. Sorry for all my questions. And thanks for helpme to resolve the last error.
     
    opsive likes this.
  43. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Won't that cause more problems though? For example, if you start a new game and enter that scene, it will still be as if you were playing from the game before starting a new game - variables will be altered as though a new game has not been started (I don't know this for sure though).
     
  44. Artificialized

    Artificialized

    Joined:
    Oct 5, 2014
    Posts:
    69
    Hey there "Opsive" been a while for me getting back into the jist of things with unity I came across this quite unique asset called "Survival Multiplayer" for $30.00 I believe its worth every penny with thousands of lines of code gone into it and commented I hope that maybe someway these 2 assets are compatible with eachother your amazingly unique "Third person controller" and their amazingly unique asset "Survival Multiplayer".Seeing both work with the unity networking system U-Net
     
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Ultimate Survival integration has been asked for a few times :) I'm holding off on adding new integrations until version 2 is released but after that is released I should be able to start adding integrations again and adding Ultimate Survival support would be pretty neat.
     
    mwituni likes this.
  46. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Justin,

    Since you mention version 2 :), I was wondering if you have been able to develop a " Find all References" feature I requested some months ago (the ability to search throughout a tree for identifying which tasks use specific variables and properties.) I would have to say it's my number one feature request since my trees have grown to a size that it is increasingly difficult to remember which tasks use which variables. This is especially true of properties since you are unable to see their value in the Variables tab of the of the editor and/or inspector. For properties, it means I have to find a task that uses that property, select the magnifying glass to reveal it's value in the task on the tree. So I spend a lot of time digging through my tree looking for tasks that use specific variables and properties. It also means I end up having unused variables because I can't remember if I am using them somewhere in my tree.

    Thanks
    Allan
     
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    This is related to Behavior Designer, correct? The next major version of Behavior Designer won't be released with the TPC/UFPS v2 release, but that is the next major thing that I have on my list after we release v2 of TPC/UFPS. I have a lot of ideas for what to include with the next major Behavior Designer update and a find dialogue is one of them.
     
    TeagansDad likes this.
  48. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    Oh sorry about that. Yes I was referring to Behavior Designer. I subscribe to both forums.

    Thanks for the update on Behavior Designer. Looking forward to it. :)

    Allan
     
  49. DougUnit12

    DougUnit12

    Joined:
    May 2, 2012
    Posts:
    11
    Greetings. I am using Third Person Controller and I've recently upgraded my system from Unity "Free" 5.5 to UnityPlus 2017.1.03f and am now getting a raft of compile errors at start-up. I have downloaded the sourcecode, but never installed it into the tree (just set it aside somewhere for safe-keeping), so TPC should still be using wrapper functions like before. It was working fine with 5.5. See attached text copied from console. Any suggestions?

    I have Behavior Designer as well, but don't have it installed for this project, so don't know if it's impacted by the upgrade or not. ( I will try that on my backup machine with a test project just to check )

    Thanks.

    - Doug
     

    Attached Files:

  50. cyeninas

    cyeninas

    Joined:
    Jun 20, 2017
    Posts:
    20
    @DougUnit12 Have you tried reimporting? I'm running 2017.1.0p1 and I'm getting no such errors, to my knowledge f3 worked fine too.
     
Thread Status:
Not open for further replies.