Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    5,122
    Glad you are enjoying it! Take a look at this page:
    http://opsive.com/assets/ThirdPersonController/documentation.php?id=91
     
  2. drakekaz

    drakekaz

    Joined:
    Jan 16, 2014
    Posts:
    43
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    That sounds like it could be IK related. If you disable CharacterIK does it work correctly? Does your movement animation move the characters feet above the ground much?
     
  4. drakekaz

    drakekaz

    Joined:
    Jan 16, 2014
    Posts:
    43
    It does. When I turn off the IK script my character's legs seem to work but now I can't look around. It also works when I apply the original shooter Animator. It must be something to do the new animations. The character's feet dont seem to be clipping through the floor if that is what you are curious about.
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Can you send me your movement animation so I can try it out?
     
  6. redjon29

    redjon29

    Joined:
    Jul 12, 2015
    Posts:
    92
    I've tried to set the blend type to additive but the If the enemy is walking and I shoot at him he continues to walk and play the hurt animation at the same time. with blend type to override He stops and play the animation and then continue walking. With this setup enemy can be interrupted. Is there any problem I am not aware?
    Another question, when i add damage visualization ability the aim ik seems to bug only the hanfs are aiming the head and body stays as a statue
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    I guess that I'm not completely following what you're trying to accomplish. If you want the Damage Visualization ability to play on top of an existing animation then you'll need to set it to additive. But it sounds like if the character is walking and the Damage Visualization ability plays then you want the character to stop? This would then be similar to this post. Or do you want different visulization animations to play depending on the movement status of the character?
     
  8. drakekaz

    drakekaz

    Joined:
    Jan 16, 2014
    Posts:
    43
    Its working now. I had to recreate the character controler. Thankfully your script is super easy and quick to use so It took no time at all. I probably edited something awhile back that caused the error.

    Thanks for your help!
     
    opsive likes this.
  9. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    So, I was just attempting to make the Clean Scene networked so I could try it out. I mostly got it working, but I'm running into one issue. I get errors about the m_Anchor not being assigned on the camera, as well as null references to inputs, until I click on the button to start hosting a server, then the errors stop and everything works.

    I was checking the network demo scene but I'm not seeing where/how it gets around that issue in that scene.

    So my question is, where is the magic that handles that in the network demo scene? How does it not have those same errors before a connection is started? Is it in the code somewhere?

    It's probably something obvious I'm missing. :p

    Thanks.
     
  10. Alexarah

    Alexarah

    Joined:
    May 1, 2014
    Posts:
    110
    Hi Opsive where do I need to start in order to implement my own AI? Basically I've already found the API to Third Person Controller but I simply want to have a hint of where to start with my own AI. My reason behind this if you're curious is I'm using dll files from A.Forge and AI4Unity that can be used to make an AI that is based off of the Fuzzy Logic. I've also become really obsessed with Neural Networks which I also have dll files for that can be used in Unity. I know AI is difficult but hey I'm willing to try.;) Sorry to say this but Behavior Trees just aren't as interesting to me.
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    What is the full stack trace of the first error? The only extra component that the network demo scene adds is the DemoNetworkManager which will execute "OnNetworkAddFirstPlayer" when the first player has joined. If you are converting a non-networked character into a networked character make sure you add the NetworkMonitor, NetworkAnimator, NetworkTransform, and NetworkIdentitiy components to it. There are not any specific network components added to the camera.
     
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Make sure you post your progress - I'm curious to see how it goes :) I've heard of somebody using markov chains with the controller but you're the first that I've heard of to use it with fuzzy logic.

    Anyway, at the core what you'll want to do is call RigidbodyCharacterController.Move. This should be called within a FixedUpdate loop and will allow your character to move in the direction based off of your AI logic. From there it depends on what goals you have for your AI - for example, if you want to start an ability you can call RigidbodyCharacterController.TryStartAbility. You can use an item with ItemHandler.TryUseItem.
     
    Alexarah and 99thmonkey like this.
  13. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    @opsive Here it is:
    And this is the other one just in case you wanted it:
    Thanks for all your help. :)
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Yeah, the anchor isn't being assigned. Does ControllerHandler.InitializeCamera get called? If so, does cameraMonitor.Character = gameObject get executed? This should all be happening without having to add any network-specific components.
     
  15. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    What's the best way to check that? I tried looking at the profiler and I don't think I see any such calls there.

    We can move this to PM if you would like, as to not spam here in the thread. Just let me know. ;)
     
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Since that method only runs once you probably won't notice it in the profiler. You can add a Debug.Log or a breakpoint to determine if it has been called. Take a look at this page for an idea on how to add either of those.
    That sounds like a good idea. Send me a PM with the results :)
     
  17. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I'm looking for the best way to make a shootable weapon more accurate the longer you aim, up to a certain point. I think lerping the spread is the way to go, but want your opinion. Currently, I have weapon skills set up (using ORK) and they adjust the spread as well and I like the way that works so I figure I'll use something similar. Spread starts out at 1/WeaponSkill (max of 100) so it goes up quickly at first but slows way down when you get better. No skill = can't hit the broad side of a barn!
     
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Lerping the spread sounds like a great way to go :)
     
    drewradley likes this.
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Version 1.3 is coming along really well and we are within a day or two of starting the beta. If you'd like to join make sure you have an account on the opsive forums and send me a PM with your invoice number. When the beta starts I'll open up a private forum for beta discussions.

    Version 1.3 is definitely our biggest update yet and I can't wait to get it released. We are still tightening up the animations but here's a preview of a new feature that we haven't mentioned yet, combos:

     
  20. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    That looks sweet! I'd definitely be interested in trying a beta. I'll go sign up there now. :)
     
  21. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Beta 1.3 - awesome - can't wait! :)
     
    opsive likes this.
  22. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    Looks great! I'm nearly ready to start integrating this for my game.
     
    opsive likes this.
  23. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Here's some screen captures of what I am working on.

    The the blue bar is the stamina not the force field or whatnot. The green circle is the ammo for the current gun. The character generator is nowhere near done. Just wanted to get it functioning so I can play with it.
     

    Attached Files:

    opsive likes this.
  24. drakekaz

    drakekaz

    Joined:
    Jan 16, 2014
    Posts:
    43
    I have a question. Is there a way to stop the hands from swaying when you turn? It tends to clip through the gun and offset the animation a bit.
     
  25. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    I have another question too. :p

    What are all the layers the demo scenes use? There seems to be some included in the demo scenes that end up being blank spaces in the inspector because I don't have those layers...
     
  26. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    opsive and atmosfearteam like this.
  27. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    drewradley likes this.
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Looks like you're really starting to pull things together. I like the green circle ammo idea - we may have to do the same for the Deathmatch Kit :)
     
    drewradley likes this.
  29. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    You can try increasing the Hand IK Weight/Adjustment Speed on the CharacterIK component. I'll take a look at it again to see if there's anything more that I can do to prevent the clipping. Version 1.3 switched to using Unity 5 as its base and I know that there were some IK improvements in Unity 5 compared to 4 so there may be something that I can take advantage of now.
     
  30. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Thanks! Been working my butt off on it! Every time I start anew for some reason or another goes much faster getting to where I was before I started over!

    I got the circular ammo UI from a different third person controller package that has been abandoned with numerous bugs! But I got some good idea and some good animations out of it anyway and some art.
     
  31. Boogius

    Boogius

    Joined:
    Apr 17, 2016
    Posts:
    2
    Hello Opsive, next update sounds very interesting. I was wondering if there was any integrated way to control melee attack animations depending on mouse movement or camera angle?
     
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Out of the box you're able to play item animations based on the idle, movement, or ability state. In your case what you could do is create a new ability which uses the mouse movement or camera angle to then determine which attack animation to play.
     
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    The 1.3 beta has started! If you've asked to be included in the beta you should be able to access this post. If you are unable to access that post please send me a PM with your Opsive forum username as well as your invoice number. I'm looking forward to seeing what everybody thinks of the new version - please keep the beta discussion within that board.
     
    julianr likes this.
  34. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    Is there a way to hide the crosshair entirely unless you are aiming? I'm sure there probably is but I didn't find anything about it in the docs and I don't really see any options for something like that. I'm probably just missing something obvious again. :p
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    There's actually not an option for this but it's a quick change. I'll send you a PM with the changed file - since you're in the beta make sure you use those set of files because this new file is based off of the beta. Once you get the new file you'll be able to select "Only Visible On Aim" within the CrosshairsMonitor.
     
    julianr likes this.
  36. Smokas

    Smokas

    Joined:
    Mar 7, 2016
    Posts:
    114
    Hi,

    Bought product and started to play with it to get hands on. One question:

    In Third Person Shooter demo - how to make objects shootable/damageable and to get red crosshair?
     
  37. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Could you send me that too :) thanks.
     
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Make sure your target object has a collider and is within a layer specified by the Target Layer on the CrosshairsMonitor

    CrosshairsMonitor.PNG

    You can add the layers though this:

    http://opsive.com/assets/ThirdPersonController/documentation.php?id=6
     
    Last edited: Apr 18, 2016
  39. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    What is the proper way to handle players being able to punch eachother? I noticed on the "Fist" object that is included in the default Dom character hierarchy in the clean demo scene that the only layer it attacks by default is "Enemy". So would I simply add the "Player" layer to that as well to allow players to punch eachother? Or would that make it so they hit themselves as well since they are also on the "Player" layer? Or is there code to prevent that? Or do I need to do something else to make it work?

    Thanks!

    EDIT: I am referring to the latest release version, not the beta, if that makes any difference.
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Yes :)
    No, the character will not hit themself.
     
  41. atmosfearteam

    atmosfearteam

    Joined:
    Nov 10, 2015
    Posts:
    42
    Ok, great. Thanks!
     
  42. Blackghost

    Blackghost

    Joined:
    Oct 2, 2012
    Posts:
    110
    How easy is it for one to implement particle systems assets, such as Realistic Effects Pack, into this asset? Is it a matter of just swapping out prefabs, and or replacing scripts? Or does some of the scripting have to be manually integrated, via mono develop?
     
  43. Smokas

    Smokas

    Joined:
    Mar 7, 2016
    Posts:
    114
    Yes, I was expecting detection by layer but when saw that Turret top node is on Ignore Raycast layer it misguided me. Afterwards I found that Enemy layer was set on first child.

    BTW Started to think about buying Behaviour Designer. I use PlayMaker but granularity level is sometimes too high and I like the way of adding new tasks :)
    Is Behaviour Designer Movement pack still free with purchase of Behaviour Designer?
     
  44. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Are you wanting to replace existing particles or add new instances where the particles are played? If you want to replace existing particles then you can just swap them out, otherwise they'll need to be scripted to add them.
     
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Awesome, and yes, it is :)
     
  46. Smokas

    Smokas

    Joined:
    Mar 7, 2016
    Posts:
    114
    OK - got Designer, thanks Justin for Movement pack :)
    First impressions:
    1. Created first patrol behaviour - a lot less clicking comparing with PlayMaker. Almost the same performance as in plain coding.
    2. Watched variables values (Vector3) in debug label are truncated.
    3. Still don't get why int and float comparisons are not merged into one numerical compare operation - maybe it is regular Unity programming style :)
    4. What I REALLY miss - "Create new task" functionality - generation of empty script template with function stubs and attributes.

    In short - fantastic product, especially I liked result propagation mechanism.
    BTW It is the last from key Opsive products I got - already have UFPS and Third Person Controller. Impressive line of successful assets :)
     

    Attached Files:

    Last edited: Apr 19, 2016
    99thmonkey likes this.
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,122
    Awesome!

    If you right click within the project hierarchy you can create a new Action or Conditional task with the basics filled in:

    create.png

    :)
     
    99thmonkey likes this.
  48. Blackghost

    Blackghost

    Joined:
    Oct 2, 2012
    Posts:
    110
    Thanks! Yes, I just wanted to replace the particle effects.
     
  49. Alexarah

    Alexarah

    Joined:
    May 1, 2014
    Posts:
    110
    Hmm I am wondering if I should try harder to create my own AI from scratch or just implement the Fuzzy Logic, Machine Learning, or Neural Networks from the DLL files I have into Behavior Designer. I'm still trying to decide between those two options. I'm mainly trying to pursue the most beneficial route.
     
  50. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Quick question - does the melee combat work with the Great Animation Combos asset?
     
Thread Status:
Not open for further replies.