Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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,820
    Awesome - yes, both FinalIK and PuppetMaster are supported. It doesn't take much to use either of those systems, for the most part it is just add the integration components and forget. Here's the doc for FinalIK and for PuppetMaster.
     
    julianr, Filhanteraren and Tinjaw like this.
  2. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    185
    Can you please give me like a hint on how I can go about integrating Simple Waypoint System?
     
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Did you figure out how SWS deals with root motion from my question before? In the end you'll need to do something similar to this article with a NavMeshAgent. The NavMeshAgentBridge should also give you a good idea on how to approach it.

    SWS integration is on my list, there are just a few things that I need to get done before I get to it :)
     
  4. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    232
    Hi Opsive I was wondering 2 thing about the new interface.

    Would it be possible color code the foldouts (at least the state names)
    It might look ugly but also might help with long lists.

    Is it possible to show an animation's setting (name,duration,multiplier...) only when you select it from the re-orderable list? So while setting the states the whole foldouts will have less lines.
     
  5. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    122
    Wow, the new system looks really cool and useful!
    The interface also looks clean, I believe most people will be able to understand it quickly.

    I have a question concerning melee weapons.
    Is there a way to hit multiple enemies at once, if they are standing close? I believe that at the moment, only the aimed at enemy gets hit (or am I wrong?)--I have some weapons which hit quite a bit of range in front of them, and if two enemies are standing close, they would both get hit.
    Also, is there a native way to define different hit areas on the enemy, like the head or the armor, that change the way the damage is calculated?

    Best Regards,
    Kristina Waldt
     
  6. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Do you mean color the idle, movement, and ability state foldouts?
    That's what it actually is doing - my editor didn't have focus with the screenshot so it's tough to see the selection. It's easiest to see in the last section where "Normal Attack" is slightly lighter than "Smash Attack". There are three selections for the three foldouts, maybe only I should allow a total of one selection?
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    The melee damage is currently calculated using a SphereCast. The way that it is setup right now it only allows for a single receiver like you said. I'll make sure this is improved upon with the next update. In the past the updates have been focused on the shooting/ability aspects, but this update is where we will bring the melee aspect up to the level that it should be :)
    One of our customers actually wrote some code which allows you to deal damage per-body part. Take a look at this post for his code. I plan on including a version of this in the next version.
     
    KWaldt likes this.
  8. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    232
    I meant, if all the underlining things under a foldout can have alternating colors, that might help with the readability.
    Can we also deselect items from the list, so its settings don't show up?

    Wonderful job as always.
     
  9. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    185
    Ok so I got with working with SWS without even coding. I just used the Navmesh movement instead of spline movement. Pretty much what I wanted.

    It would be nice if you still looked into integration though but it works with navmesh for now which is perfect.
     
    Last edited: Feb 26, 2016
  10. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I'm having trouble with curbs and the only way to go up them is to either have them very short or to turn one way or the other. I assume that works because the step offset z. But even if I set the step height and offset settings to something outrageous like 10, it still doesn't work for curbs.
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Thanks for the idea - I don't want it to be an obnoxious color so it may be a different type of fading.
    This interface is using the ReordableList and when I selected outside of the area the element did not select. I'll see if there's a way to allow deselection.
     
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Add the following to RigidbodyCharacterController.CheckMovement within the if m_InputVecotr.sqrMagnitude block:

    Code (csharp):
    1.  
    2. Debug.DrawRay(m_Transform.position + m_Transform.up * m_StepOffset.y, localInputVector.normalized * (m_CapsuleCollider.radius + m_StepOffset.z), Color.green);
    3.  
    This will allow you to visual where the step checking is occurring and should give you a better idea of what to set for the step offset.
     
    drewradley likes this.
  13. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    232
    You're absolutely right on that. If you ever consider doing that, you might want to try the Speadsheet style 2 color alternating. One lighter or darker than the other one.
    And hopefully Reorderable lists allow deselection.

    Thanks for considering Opsive!
     
    opsive likes this.
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    The Third Person Controller has a promo video!



    This video was created with the Third Person Controller and Cinema Director. The Cinema Suite happens to be on sale now so it's worth checking out. It actually worked out really well because I can replay this scene at any time and make small modifications until everything is perfect. This video is also why the Cinema Director integration exists :)
     
    99thmonkey and TonyLi like this.
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,828
    Nice. I'm also picking up the Cinema Suite before the sale ends. Cinema Director is on my must have list.
     
  16. jailbar

    jailbar

    Joined:
    Nov 21, 2012
    Posts:
    49
    Hey, I have a question. I am currently using UFPS as my main character controller for my game, and I am desperately looking for something in which I can control a horse as well. Basically, I want to disable the UFPS controller and enable a different controller to control a horse (to simulate riding a horse) I understand that I would need to disable the UFPS character while riding the horse, but my concern is, would this character controller be able to control an animated horse?

    This is the animated horse pack that I have. ( https://www.assetstore.unity3d.com/en/#!/content/24869 )

    That pack uses an AnimatorController as far as I know. I am not extremely familiar with this particular topic, as far as character controllers and animators go, so I just need to know how hard it would be to make this work as a horse controller for that horse pack.

    I did see a horse on the asset store screenshots, but didn't see much more than just a sample picture. Is this something that can easily be done with this controller?

    Have a good day.
     
    Last edited: Feb 27, 2016
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Yes, the controller works with generic objects so it definitely can control a horse. We did not create the horse model or animations so we weren't able to include the sample scene used for the screenshot, but this post has the scene used. You'll need to download the free horse separately.

    Since you are just wanting to control a horse I don't think that it will affect you, but UFPS and the Third Person Controller will not work with each other so for example you won't be able to add the Third Person Controller Health component and do damage to the horse with a UFPS weapon. This integration will come with UFPS 2.
     
  18. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,828
    As I'm making my game I've come to the conclusion that I sometimes try to put too many bells & whistles into my design. I see the latest shiny asset on the Unity store and I think "Ooooh, I can put that in my game and have x, y, z cool effect." But then I try to put all those bells & whistles in the game and it grinds to a halt because I'm taxing the system with every one of the latest uber effects and techniques. Then I watch videos like the one below from a AAA game made by a huge company with thousands of team members and multi-million dollar budgets and it smacks me in the face that even they don't do some of those things. Case in point. Watch the video below at the 16:10 marker and watch Lara Croft swim. Notice how there isn't even a splash. No splash? On a AAA, multi-million dollar game? That's right. No splash.

    Lara Croft Video

    So, it's a sober reminder to focus on what's important in the game and worry about bells & whistles later and only if it doesn't kill the game performance. Not that splashes would kill performance in this case, but it's just one example of many. Another example is that I wanted to have dynamic snow building up when it snows. And yet, here again in Tomb Raider they have great snowy atmospheres and no snow buildup. Does anyone complain about it? Nope.

    This is sort of off topic, but since TPC has swimming with splashes it got me to thinking. And it's helping me stay on track with the more important things.
     
    opsive and Tinjaw like this.
  19. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    122
    Wow, this sounds like the next update's going to be a blast!
    I look forward to it, and thank you for your hard work!

    - KW
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    That's it, we're removing the splash ;)

    I completely agree with you about focusing on the core and not worrying so much about the extras - especially at the indie level. Focus on what makes the game fun, and water splashes aren't going to make the game more fun. With that said, I also think that the Asset Store allows you to add more of the extras since the less-core packages can be added almost instantly. You then just need to test for performance and compatibility with the target platforms.
     
  21. ak0382nflakn309gn

    ak0382nflakn309gn

    Joined:
    Feb 29, 2016
    Posts:
    6
    I noticed in your demos that when the melee functionality is triggered, the char cannot move.

    How easy is it to allow the player to walk/run while melee'ing?
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    In the clean scene the character should be able to move while a melee attack is active, but in the current version it is more limited than I would like. Right now you can basically choose if the lower body should be used or not when attacking, and this is why for the adventure demo you cannot move. In the adventure demo the lower body is included which only contain an idle animation.

    There are some major improvements coming to the next version dealing with this topic. Take a look at this post for some details, but the goal is to give you complete flexibility with what item animations should play. Since that post I have cleaned up the interface some more and also added support for combos. The system is in place and is working well, now we just need to add some proper animations for it. As soon as we do that we'll be sending out a beta - send me a PM or email with your third person invoice number if you'd like to be included in it. I won't have the documentation done when I send out this beta so I recommend that you first have an understanding of how the existing system works.
     
    Last edited: Feb 29, 2016
  23. ak0382nflakn309gn

    ak0382nflakn309gn

    Joined:
    Feb 29, 2016
    Posts:
    6
    Thanks for your reply. So assuming we were to buy / use this before your next update came out.... I have a few more questions:

    1) I noticed in your demo that the player alternates between slashing right or left.
    Is this slash animation determined at random? And if so, how easy would it be to add more random slash animations?

    2) You say there's a network demo in the package ... which networking technology or services does the demo use? And does this networking demo essentially show how to add players to a scene and have them run around & damage each other, kind of like a mini deathmatch game?
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    With the current version it can be determined at random or in a sequence. The next version allows for random, sequence, or combo. You can have as many animations as you'd like.
    It uses UNET and the sample scene includes a character with a pistol or rocket launcher. When you load in another character it allows you to damage/kill that character.
     
  25. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,483
    Just started working with this. What version of Rewired did you integrate against?
     
  26. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    It has been tested against the latest, 1.0.0.81.
     
  27. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,483
    Thanks.

    Unity 5.3.1 (Windows 64-bit) - running on Windows 8.1 PRO
    Rewired: 1.0.0.81
    Opsive 3rd person controller: 1.2.2
    Opsive's Rewired integration (January 1, 2016)

    I was looking at the integration and looking at the various maps. The keyboard maps, joystick maps, and mouse maps. It appears that joystick maps are not mapped. I would have expected it to be mapped to the dual analog gamepad template so all of the gamepads just work. Don't know if this is just oversight, or the information did not get saved into the integration example scene.

    The scene does run correctly using keyboard and mouse however.

    Here is a screenshot below of what I see for the joystick maps.

    joystick_mapJPG.JPG
     
  28. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    When I added the Rewired integration I only tested it against a keyboard so that's why there are no joystick maps. From the Third Person Controller side of things it doesn't matter if you are using a keyboard or a joystick so that's why there's no mapping within the sample scene.
     
  29. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,483
    Thanks for the clarification on what was tested. I guess I was expecting it to be like Rewired's UFPS integration where the gamepad works automatically.

    My original interest was due to someone was trying to get both products (Rewired and 3rd Person Controller) working together. He posted in the Rewired thread so that is what got my interest originally and it was a good time to pick up 3rd Person Controller too.

    http://forum.unity3d.com/threads/rewired-advanced-input-for-unity.270693/page-34 (start at msg #1658).
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Especially with our UFPS acquisition I guess it's a little shameful to admit but I haven't tried the Rewired integration with UFPS :oops:

    Before that first post tapticc didn't get the integration files from the web page - as soon as he did that I think that everything has gone well. So far I haven't had any reports of any problems with the Rewired and the joystick - somebody did have an issue getting 4 player coop to work because of PlayerInput's static nature but I've since changed it so PlayerInput is no longer static. This will allow you to have as many active characters as you'd like on the same machine using the Rewired integration.
     
  31. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,483
    Rewired integration with UFPS is great. It is the only way to run around skycity. It works very well with gamepads immediately and I have mapped in other controllers too. Arcade Guns Light Gun, and various flight controllers (CH FighterStick, CH Eclipse Yoke, and CH Pro Throttle) and rudder pedals and it works very well. I was tempted to try a racing wheel too but have not done that yet.

    Hope to start digging more into Third Person controller this week.

    Looking forward to the future UFPS2 also.
     
    opsive likes this.
  32. Fraust

    Fraust

    Joined:
    Jul 2, 2012
    Posts:
    16
    noobie question... (all from top down mode)

    So, when I remove the camera controller/handler and only leave the monitor, the ik debug line runs into the ground. If I pause, play, disable the controller/handler... ik works fine. If I have all three disabled, start the game, the controller/handler wakes up... ik looks broken until I wake up the monitor, and still seems fine if I turn off the other two. I was under the impression I could use my own camera controller but there is some link I don't know about maintaining. At least, it seems important when the monitor first wakes up to get something from the controller. I just downloaded the asset so no, I haven't peeked at the source yet.

    Second, is there an isometric style mode? My game was running perspective but with the 45 degree rotation. The controller here seems like the axis is world aligned and not screen aligned. In other words, in the demo the level is straight on with the camera and "W" moves up in world and screen space. If I rotate the camera, "W" is still up in world space but screen space is now at that 45 degree slant. I ended up rotating my whole level instead of the camera.

    And... is it just me or does the character run faster on a diagonal rather than on an axis?

    Thanks for any insight you may have.
     
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    You should be able to use your own camera controller as long as you have the CameraMonitor attached. I just removed the CameraHandler and the CameraController within the clean scene and the debug raycast looked in the correct direction. Are you by chance using a different view type other than third person? If so you'll need to implement the ViewMode SharedProperty within your new camera controller class. Here's some info on SharedProperties:

    http://opsive.com/assets/ThirdPersonController/documentation.php?id=44

    There is not a true isometric style mode, with the main reasoning being like you said that the top down mode requires an axis aligned world. I have it written down to improve upon this so top down does not require axis aligned but I haven't been able to get to it yet.

    I just compared the root motion forces. Running straight has a magnitude of about 0.9 while running diagonal has a magnitude of about 0.93. So it's animation related - we'll get that evened out in the next release. In the meantime you could adjust the speeds that the animation states play within the movement blend tree.
     
  34. Fraust

    Fraust

    Joined:
    Jul 2, 2012
    Posts:
    16
    Yeah, guess I'll need to research that. Not using third person view... I saw that view working fine. I'm doing top down. Hmm, ok, gives me homework to do. I guess that makes sense now when I saw the raycast going into the ground.

    Well, actually, I was playing around with root motion turned off but in top down mode in the clean scene.

    So far, pretty excited to dig into this. I was working on my own controller and realized I was burning too much time. So I saw the sale and thought, hey, perfect timing! I have behavior designer too so I knew it should integrate just fine. I saw a tree you worked on earlier in this thread and I need to go study it now...

    Thanks!
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Good catch! Open RigidbodyCharacterController.cs and change:

    Code (csharp):
    1.  
    2. m_GroundVelocity += LocalInputVector * m_GroundSpeed;
    3.  
    to:
    Code (csharp):
    1.  
    2.   var localInputVector = LocalInputVector;
    3.   if (localInputVector.sqrMagnitude > 1) {
    4.     localInputVector.Normalize();
    5.   }
    6.   m_GroundVelocity += localInputVector * m_GroundSpeed;
    7.  
    This is within UpdateGroundedMovement
    That's awesome! Yeah, that tree has been a great example for one way to structure a behavior tree.
     
  36. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,093
    How well does TPC support quadrupeds -- that is, four-legged, non-cylindrical characters which are longer than they are tall or wide?
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Currently a CapsuleCollider is required for any model type (humanoid or generic) but I plan on looking at removing this requirement in the next version - we have a pretty cool demo planned where one of the models doesn't fit the CapsuleCollider shape too well. Beyond that, there are no other requirements for a generic model.

    With that said, your quadruped may be able to fit inside a CapsuleCollider with the current version without a problem - just decrease the height and increase the radius of the CapsuleCollider.
     
  38. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,093
    Thanks much for the quick reply. Our animals need the capsule controller to be rotated 90 degress, so it's parallel with their spine (like a dog or cat). Will that work with the current version, or would it need to wait for your upcoming version?
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    My goal is to remove the need for a CapsuleCollider completely. A dog or a cat is a perfect example of a use case where a CapsuleCollider doesn't fit the shape of the object too well. Since you are not able to rotate the CapsuleCollider within Unity you'll need to wait for the update.
     
  40. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,093
    Okay, great. We're not in urgent need (just want to get TPC while it's on sale), but do you have a guesstimate when that update will be released?
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    This release is going to be one of our biggest yet and we're at the beginning of it so in this case I don't have an estimate - we'll get it out as soon as we can!
     
  42. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,093
    Sure, I totally understand. And sorry to persist...but are you imagining a 1-2 month timeframe or 3-5 month or more?
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    If you look at our release history you'll see that we release pretty regular updates. We are also working on the Deathmatch Kit and getting ready for UFPS 2 development but I still expect to release regular and frequent updates for awhile.
     
    Last edited: Mar 1, 2016
    julianr likes this.
  44. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,093
    cool, thanks!
     
  45. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Hello , I have two questions:

    -How to make a living interface of the player as in the demo ? I did not understand

    -His would be possible to add a bar interface of hunger and thirst in scripts ? as some RPG
     

    Attached Files:

  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Can you explain more by what you mean by living interface?

    Hunger and thirst is more game specific so for this I recommend creating a new component which tracks these parameters.
     
  47. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    "Can you explain more by what you mean by living interface?"
    sorry this is google translation that translates oddly

    How to add a UI interface of life of the player?
     
  48. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,818
    I think he means simply connecting his stats, such as hunger, etc., to the game. He wants it to work for the player. Unfortunately, this has nothing to do with the 3rd person controller. :)
     
    opsive likes this.
  49. redjon29

    redjon29

    Joined:
    Jul 12, 2015
    Posts:
    92
    Hi, I don't know why when I crouch with a weapon in hand the capsule collider don't get smaller. But it does in the demo scenes do you know why?
    New video of my work
     
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    4,820
    Did you change the crouch animations? If so make sure you also add in the curve on your animation clips:

    curve.PNG

    Looks like you're making a lot of progress! This next update should help with your closer combat situations.
     
    TeagansDad and redjon29 like this.
Thread Status:
Not open for further replies.
unityunity