Search Unity

  1. Megacity Metro Demo now available. Download now.
    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. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Hi there. I am just starting with this great asset and was able to setup my own character very quickly.
    I do have a question though about weapons. I noticed that it only looked for the right hand. Is there a way to make it have a weapon in both hands? So a right and left attack Or both attack?
    Thinking while at work making the day go so I can get home and play lol.
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Glad the character creation process went smoothly :)

    Having items parented to a single hand is a limitation in the current version. There have been a a couple other requests for this feature though so it will definitely be in the next update (0.89). I am submitting a bugfix update now (0.88) but I should be able to get to this next week - I'll send you a new version for you to try out as soon as I do.

    This will definitely be a good thing to add because it will enable things such as having a shield or duel-wielding weapons.
     
  3. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Awesome. Looking forward to it.
     
  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Version 0.88 beta has been submitted to the Asset Store and has been sent to opsive.com purchases. You can see the change list here. This was a bugfix/polish release - I promise that the next release will be more exciting :)
     
  5. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Awesome. Thanks!
     
  6. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    With the adventure camera, is there a zoom function with the mouse wheel?
    found it. I really have to learn to read...
     
    Last edited: May 8, 2015
  7. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Hey Opsive great work as usual. I have one issue that might just be unique to me? I use rewired for input and whenever there is an update I have to make sure to do your update of player input, which you make extremely easy with the menu handling it automatically. If I forget to do this the profiler shows behavior designer causing a huge slowdown from greater than 200 FPS to less than 20 FPS (this is running the third person controller demo).

    That's not a big deal. But then I was wondering if someone makes a commercial game and maybe the player unbinds some keys somehow could that cause the same issue in a finished game or is it enough that it works when the game was compiled?

    Very noobish question I know but thought you should know just in case.
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Hehe, no problem. You can right click to zoom but right now there is no way to magnify the zoom with the scroll wheel. Is that what you are referring to?

    Chances are the huge framerate drop is because the console is spamming you with messages saying that the input binding cannot be found. This message is editor only so you won't have that problem. I can't think of a way the player is able to unbind an input mid-game though so you should be safe as long as you ship with the correct bindings.
     
  9. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Ah, didn't think of the messages in the console. That makes perfect sense. Thanks.
     
  10. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Ya zoom in on the character with the mouse wheel. Basically minimizing the distance from the target location (players head) and the camera.
     
  11. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Is there anyway to use only one set of animations for all weapons?
     
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    I've written that feature down. It should be pretty easy to add so I should be able to add it with the next update. Within the Camera Controller inspector you can set the zoom offset, and what I am imagining is that it will just interpolate between the standard offset and the zoom offset based on how much you have scrolled.

    Definitely - within the Item Type for each weapon just set the same Item Name value. This will then tell the Animator to use the same substate for each weapon.
     
  13. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Thanks!
     
  14. TheLetterS

    TheLetterS

    Joined:
    Jan 22, 2013
    Posts:
    31
    Another art update! These are two screenshots from the living quarters area. Naomi will spawn in this area and she can climb the ladder out to the rest of the scene. This is the last indoor area of the scene.
    LivingQuarters1.png
    LivingQuarters2.png
     
    gurayg likes this.
  15. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Looking really good there!
     
    TheLetterS likes this.
  16. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Now... are you going to be using Adventure Creator to build the mechanics of your adventure scene?
     
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Most of the useful functionality from the adventure scene is going to come from the new items and abilities such as climb, push, pull, etc. Both of these can be added with the Third Person Controller framework so Adventure Creator is not needed.

    There are other smaller things which Adventure Creator could be used for. This includes opening the door from this screenshot when the switch is pulled. However, we don't want to require Adventure Creator in order for this scene to work so we'll just script a small component that opens and closes the door.
     
  18. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Yeah... I figured that would be the case, I do plan on using your controller for my adventure game just because of all the added control that I will have but use AC for everything else. Are the added abilities in the MC/AC setup package?
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    That makes sense. Are you talking about the Adventure Creator sample project? I don't think that character has any abilities added to it but that's as easy as selecting the ability from the RigidbodyCharacterController.

    When you get into the integration with Adventure Creator let me know how it goes. This was the first time that I used Adventure Creator so I'm interested in hearing if anything can be easier/more fluid.
     
  20. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    How did you go about it... What was your procedure... add MC to your character prefab and get everything working the way you want then import AC setup your scene then add your character to AC as a player then turn the controller off on AC...
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    What does MC stand for?

    The only thing extra that you have to do is add the AdventureCreatorControllerBridge component which is included with the Adventure Creator integration package. You will want to first create your character with the Third Person Controller Character Builder, then add the Adventure Creator Player component. From there once you add the bridge it will switch between the Third Person Controller and Adventure Creator for controlling the character.
     
  22. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Sorry MC = Movement Controller it was just less letters than TPCCB... o_O

    And thanks, just wanted some clarification on workflow.

    Very excited.....
     
  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    What about TPCRCC for Third Person Controller Rigidbody Character Controller? ;) Ok, maybe you're right and MC is easier.

    Yeah, the integration with Adventure Creator is pretty straight forward. You shouldn't have to do anything extra after the initial setup.
     
  24. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Could you add the option to have the player be invincible for a few seconds after he is respawned? And also a revive animation with the ability to revive instead of respawn.
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    For invincibility, sure - that's a quick change. You can add it by opening Health.cs and add the following member variables:

    Code (csharp):
    1.  
    2.   // The amount of time that the object is invincible after respawning
    3.   [SerializeField] private float m_InvincibleAfterRespawnTime;
    4.  
    5.   // .. under Internal Variables ..
    6.   private float m_SpawnTime;
    7.  
    Then add this to Awake:
    Code (csharp):
    1.  
    2.   m_SpawnTime = -m_InvincibleAfterRespawnTime;
    3.  
    And modify the top if statement on the top of the Damage method:
    Code (csharp):
    1.  
    2.   // Don't take any damage if the object is invincible, already dead, or just spawned and is invincible for a small amount of time.
    3.   if (m_Invincible || (m_CurrentHealth <= float.Epsilon && m_CurrentShield <= float.Epsilon) || m_SpawnTime + m_InvincibleAfterRespawnTime < Time.time) {
    4.     return;
    5.   }
    6.  
    And finally add the following to OnRespawn:
    Code (csharp):
    1.  
    2.   m_SpawnTime = Time.time;
    3.  
    The revive animation isn't as quick of a change but I just wrote it down. We probably won't be able to add it until after the adventure scene is out.
     
    Last edited: May 12, 2015
  26. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    That was quick!
     
    opsive likes this.
  27. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    3pc.jpg
    Great controller!
    It seems there are some issues with behavior designer integration demo. Lot of objects in the scene have missing scripts. For instance "Main Camera" misses 3 scripts. Unity 5.0.1. Steps to reproduce:
    Import TPC, import TPC source, import BD, import BD integration and sample
     
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Appreciate it!

    Are those the only scripts that are missing? If so I actually think that you have everything. When we take the screenshots we add some image effects and those three missing components look like they are from that. I thought my build process automatically removed these but I guess it didn't.
     
  29. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    There are more and scene does not work correctly:
    Top Patrol(after Character Ragdoll)
    Bottom Patrol(after Character Ragdoll)
    Guard(after Character Ragdoll)
    Game - GUI Manager
     
    Last edited: May 12, 2015
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Go ahead and give the sample another try. I just tested it on a fresh project and there aren't any missing components anymore. The soldiers use a couple of the Movement Pack tasks for pathfinding so make sure you have also imported that asset. You'll need the Third Person Controller integration package with that as well.

    Also, if you haven't seen it, take a look at this topic. It will go through and explain why the tree is setup the way that it is.
     
  31. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Last edited: May 13, 2015
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    When did you purchase Behavior Designer? If it was anytime recently then I can send it to you - send me a PM or email with your invoice number.
     
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Within the Character Builder it asks you to specify a dominant hand and this hand will be the parent of all of the items. I've gotten a couple of questions asking to remove this restriction so you can have items in both hands. I just finished adding this feature so let me know if you want to try it out now. We don't have any new animations created for a left handed item but the code will now allow you to do it.

    To make the change, the only thing that you have to do manually is add a new child GameObject to your non-dominant hand with the ItemPlacement component. You could also run the Character Builder again and it will do it for you automatically.

    items.PNG
     
  34. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Sweet! Will be testing this out tonight after work!
    Double kama here we go!
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Unfortunately dual-wielding items aren't supported yet - this is step one in getting there though. :) I need to make some modifications to the Inventory in order to allow you to dual-wield.
     
  36. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    May I ask, what's covered with the AC integration?
    Inventory? Save/Load system? any new Actions (nodes) for AC?
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    The Adventure Creator integration just allows you to use your Third Person Controller character within Adventure Creator. There is a component which will toggle control between AC and TPC depending on what is going on within the AC world. The first time that I used Adventure Creator was for this and Behavior Designer's integration so I am definitely open to expanding it.
     
  38. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Well as you may already know, there are some written tutorials about integration on;
    http://www.adventurecreator.org/tutorials/third-party-tools-and-customisation
    that covers the "custom actions" ,inventory and the save/load parts. Guess the most important part is the "constandID" part of them.
    If you're asking what kind of "custom actions" would be useful with this integration, I'd need much more time to clearly spell out.

    but it's great to know that you've our back on that one :)

    Thanks Opsive team!
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Yeah, I've created a couple of actions for Behavior Designer so I'm familiar with that process. Having a list of useful actions would be great - I could create some actions that I think would be useful but it's much better to hear from somebody who will actually be using it in their game.
     
  40. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    300
    will it be easy to get the AI to use the push, pull, open and the other animations like crawling, jumping, climbing?
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    It is now :)

    I just added two Behavior Designer tasks which will allow you to start and stop the abilities. The best part is that it doesn't require any core code changes so the tasks are available now on the integrations page.

    ability.PNG

    Edit: To add to this, this list is dynamic so the list will automatically update when new abilities are added.
     
    Last edited: May 18, 2015
    MikeTon likes this.
  42. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    hi i have a few questions, is this compatible with unity 5.1

    i'm only interested in the 3rd person movement script and the camera script. i dont need the full kit just that break down, do you have a separate package for that preferably as i will be adding my own weapon system and inventory system, i just haven't had time to figure out the Animator system yet and plan on pulling this apart any ways for a game with 3rd person and Fps controls. i got all the Fps components down and ready to prototype, i just need a 3rd person shooter character controller that is all.
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Thanks for taking a look at the Third Person Controller!

    Yes, it is.
    We don't have a separate package but the scripts are modular so you shouldn't have too much trouble pulling it apart. The base controller component doesn't actually even know about the inventory or which weapon it is holding. This communication is done with the event system and shared properties/methods.
     
    RealSoftGames likes this.
  44. chines

    chines

    Joined:
    Apr 21, 2015
    Posts:
    5
    Hi,

    I've been learning this package and so far it seems to work well. The one thing I can't get to work though is the controls on mobile. I'm using the Third Person Shooter demo scene and building for Android. I've tried it on two tablets and a phone. I'm also using Unity 5.0.1 and version .88 of the third person controller. Here's what I've done:

    1. Unhide the mobile buttons inside the Canvas->Mobile Controls object.
    2. Checked the "Force Mobile Input" checkbox in the Player Input script

    The camera and player controls work now - they didn't work before I checked the "Force Mobile Input" checkbox, but none of the buttons along the bottom of the screen like Jump and Action work when pressed - or at least they don't do anything. Am I missing something obvious? The manual doesn't really explain a whole lot about the mobile controls.
     
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    You shouldn't have to make any changes to get the mobile input to work, it should just work automatically. You do have to make sure you first import the source code because the DLL doesn't recognize that it is on a mobile platform. I just added that to the docs under the mobile section. The Force Mobile Input checkbox is for if you want to show the mobile GUI while within the editor.
     
  46. chines

    chines

    Joined:
    Apr 21, 2015
    Posts:
    5
    Ok I downloaded the source and recompiled the project but it still has the exact same problem. I can move the camera and the player using the "move" and "camera move" virtual buttons but the others do nothing.

    Is there anything else I am overlooking?
     
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Are you trying to use the mobile controls with a character that you created or one from one of the demo scenes? If it is one that you created, does the keyboard/mouse input work with the mobile button that you are pressing? For example, if you are pressing the "Jump" button, does the character jump when you press the space bar in non-mobile mode? What I am thinking is that if you are using your own character then the jump ability hasn't been added yet.
     
  48. chines

    chines

    Joined:
    Apr 21, 2015
    Posts:
    5
    It is just the character from the demo scene, "Doug." Maybe I'll try one of the other demos. I was also going to try the Unity Remote to see if I can debug it in any way.
     
  49. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,125
    Here's what I did to get it working:

    1. Created a fresh Unity 5 project
    2. Imported the Third Person Controller from the Asset Store
    3. Removed the scripts dll and replaced it with the source code
    4. Opened the Start Window and clicked Update Input Manager so it would have the correct key bindings
    5. Opened the Third Person Shooter scene
    6. Disabled the lights within the scene. This isn't necessary but there are a lot of realtime lights so a mobile device would quickly get bogged down by it.
    7. Hit play to make sure it would work with a mouse and keyboard
    8. Switched build target to Android
    9. Built the Third Person Shooter scene
    10. Ran the shooter scene on a Nexus 7
     
  50. chines

    chines

    Joined:
    Apr 21, 2015
    Posts:
    5
    Thanks for listing all of that. I got it working now following those steps. I'm not sure what the problem was with my old project but I might have messed some things up trying to get it to work before. Thanks again!
     
    opsive likes this.
Thread Status:
Not open for further replies.