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

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Hi Does this asset have tap on screen to shoot functionality. I mean for touch to shoot is it Supported. Or any way i can get it to work
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    It has virtual buttons for mobile controls so you could create a large textureless button which covers the entire screen in order to shoot.
     
  3. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    Sorry for not being specific what i meant was click/touch an enemy on screen to shoot.
     
  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    It doesn't have that built-in but it would be easy to add:

    You'd still have the large invisible button and when that button is pressed you'd fire a raycast to determine if it hit an enemy. If it hit an enemy you'd then call ItemHandler.TryUseItem:

    Code (csharp):
    1.  
    2. if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), Mathf.Infinity, 1 << LayerManager.Enemy)) {
    3.    m_ItemHandler.TryUseItem(typeof(PrimaryItemType));
    4. }
    5.  
     
  5. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi Justin. When using Horse Animset Pro with Third Person Controller, mounting the horse removes all of your weapons from the inventory, when you dismount you have nothing. It doesn't give them back :)

    Edit:
    Also, (after dismount) the controller goes funny when you only have your fists, after pressing down the left mouse button to hit then places it in the fighting pose and does not go back to idle.
     
    Last edited: Aug 7, 2016
  6. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    The Horse Animset Pro integration was done by the Horse Animset Pro dev - I'll get in contact with him to see what's causing it.
     
    julianr likes this.
  7. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Ok thanks Justin.
     
  8. tubswitch

    tubswitch

    Joined:
    Feb 25, 2016
    Posts:
    7
    Hello. I'm looking to purchase a Third Person Character Controller for a project, and your product seems like it would fulfill most of my needs. However, after reading over the documentation and watching several of your videos, I have several questions to determine if it is the right product for my project.

    1. My game requires running on rolling terrain and slopes at high speed.Up until now, I've been using an implementation of the free Super Character Controller, which clamps the controller to the face of the ground, registers the face normal, and allows you to adjust the rotation of the controller to that normal to angle to character to the surface it's standing on. Is this a feature of the Controller?
    2. Does the controller use Rigid Body physics, or a custom physics system? In my experience Rigid Bodies tend to fly off of slopes when moving at high speeds unless clamped to a face as I mentioned above.
    3. Does this controller work with non-bipedal/humanoid characters, such as monstrous enemies?
    4. As mentioned in the documentation http://opsive.com/assets/ThirdPersonController/documentation.php?id=118, there is a system for combos included in the controller, but it seems that it only accounts for single-button combos with a timeout. Is it possible to extend the default Character Animator Options to allow for other features, such as branching combos (for example, if x button is pressed within x window, play this animation, while if y button is pressed play another,) allowing for cancelling out of the animation early within a certain window, or terminating an attack when it collides with certain surfaces?

    Thank you for your time.
     
  9. opsive

    opsive

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

    "Align to Ground" on the RigidbodyCharacterController will orient the player to the ground but it will not clamp it. I like the suggestion of clamping to the ground though, and if you want to add it before I do then it would be a pretty small ability.

    It uses standard Rigidbody physics.

    Yes, it does.

    That scenario was exactly what I had in mind when I extend the combo system. Version 1.3.3 will be going out in a couple of weeks to support the Deathmatch AI Kit and after that is released we'll be starting on version 1.4. I'd like to include this in version 1.4 and can send you a new version to test out as soon as I do.
     
  10. tubswitch

    tubswitch

    Joined:
    Feb 25, 2016
    Posts:
    7
    Thank you very much for your quick reply.

    I had previously been comparing the Invector Third Person Controller to yours, and with the addition of the updated melee system in alongside your support for slope rotation and firearms, it seems that your controller is just what I need.
     
    TeagansDad and opsive like this.
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I've analyzed these 2 controllers a lot and although Invector's does have some very nice features and is very easy to set up and use, it suffers from huge performance issues. This is something you may not necessarily notice on a high-end PC, but when I ran the demo scene on the Wii U, even with every possible optimization at my disposal, I could not maintain even 30 fps. It would generally be between 15-22 fps. Whatever the bottleneck is, I never found out, but I abandoned that asset and am sticking with Opsive.
     
    TeagansDad, RoyalAllen and opsive like this.
  12. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Any plans to add a grenade trajectory indicator?
     
  13. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    I have had it on my list but haven't had too many requests for it so it hasn't been that high of a priority. You just added another vote for it - maybe in a 1.4.x update?
     
  14. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @magique

    Interesting, I'd interested to know more about what actually is a problem for performance, even it's just a hunch.

    I've been looking into both of these assets, and just checked out some tutorial videos of Invector's asset. Seems like one reason for slowdowns might be close combat stuff and hit detection as it adds 3 colliders for each limb, unless I understood meaning of those yellow-green-red boxes incorrectly. So could it just be too many triggers/collider checks?

    NOTE: I haven't read the manual / docs if there is such available before purchase, so I'm only guessing...
     
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I have no idea. I even turned off ragdoll, reduced solver iterations, turned off head look, baked all lighting, eliminated any physics collisions that were unnecessary, etc. Still no go. I just don't have time to optimize their code so I abandoned it. Opsive's code has always been efficient and high performing and is more friendly to expanding it without touching the core code.
     
    eses and TeagansDad like this.
  16. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @magique, @ eses:

    One possible contributing factor is their use of SendMessage() throughout the code base, as I know that can cause performance issues. Opsive's EventHandler is a much better way for components to communicate with one another.

    My primary issue with Invector's controller is that it is impossible to extend its functionality without heavily modifying the main source code, which makes it a major hassle to keep up with updated versions. Case in point, they're already warning users that the next update will not be backwards compatible. Opsive's TPC and ootii's Motion Controller are the only ones worth considering, in my opinion.
     
    magique and eses like this.
  17. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @TeagansDad @magique

    Thank you both of you.

    Seems like I did read most if not all comments in Asset Store, but seems like it's hard to come by this kind of enlightening information / opinions.

    @TeagansDad (and anyone else) - What is your view on Ootii's MC vs Opsive TPC?

    @opsive Hopefully this is OK to ask here?

    0. Based on what I've read, both have support for generic actors, not just bipedal humanoids.

    1. Both seem to be very modular and robust, Ootii seems to be even more so, to me it seems bit hard to get grasp just by watching Tim's videos, I guess only way to find out is spend money and see if it suits me / my level, or keep reading manual... TPC seems a bit more straightforward in this sense, not so abstract at least based on Asset store / quick glance at Opsive page.

    2. Both are both character and animation controllers, with modular extensibility for abilities and animations if I got it correctly.

    3. Movement, this is bit unclear to me, I got the impression that MC is not using RigidBody Physics (AddForce and the like) and about TPC I'm still not sure about how it works exactly, I got the impression it uses RB physics based movement?

    4. Both seem to be robust and extensively documented and have active forum threads.

    5. Opsive's TPC might integrate better and more with other products like their Behavior Designer, and other asset support seems extensive. It also has extras like camera controller, ready made genre examples, inventory, pickup etc. gameplay features, whereas in MC you'd have to buy these features (camera system).

    Choices, choices.
     
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    No problem - I'll stay out of the direct comparisons but I can answer one of them:

    Yes, the current version of the Third Person Controller uses the Rigidbody physics system to move (by setting the velocity value). After the Deathmatch AI Kit is released our next big project is to integrate the Third Person Controller and UFPS. I really like how UFPS handles its movement so one of the things that I'll be doing is removing the Unity CharacterController component from UFPS and instead adding a kinematic Rigidbody while using the existing UFPS movement code. This will then be used as the base for both UFPS and the Third Person Controller.
     
    Malbers, eses and magique like this.
  19. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    We really need a way to fine tune aiming on mobile.
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Can you give more detail?
     
    Last edited: Aug 13, 2016
  21. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Most mobile shooters allow you to adjust your aim while shooting. Some even have an extra joystick for the camera thats also the shoot button.
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    So you're looking for beefier mobile controls? I'd recommend taking a look at Control Freak or Easy Touch - both of those are assets dedicated to mobile input so you'd have a lot more options with those.
     
  23. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    I actually already own control freak. Was trying to keep extra apis to a minimal as they slow your game down. Guess Ill go look at what he's doing and try to add it myself.
     
  24. Fraust

    Fraust

    Joined:
    Jul 2, 2012
    Posts:
    16
    Two things,

    The recent updates to TPC and Rewired broke the right stick in top down again. Before I would override UseMouseInternal in the Rewired file. Now I had to do this:

    Code (CSharp):
    1.         public override float GetAxisRaw(string name)
    2.         {
    3.            
    4.             tempMousePos = m_Player.controllers.Mouse.screenPosition;
    5.  
    6.             if(tempMousePos == prevMousePos)
    7.             {
    8.                 if (name == "Mouse X") name = "Right Joystick X";
    9.                 if (name == "Mouse Y") name = "Right Joystick Y";
    10.             }
    11.  
    12.             prevMousePos = tempMousePos;
    13.             //Debug.Log(name);
    14.             return m_Player.GetAxisRaw(name);
    15.         }
    Seems to work again. Hope this snippet helps others.

    Second is a question, any plans to add aim assist or lock on in top down mode? Specifically, before switching to TPC, I had a look-at constraint if the enemy was in front of the player line of sight. It was a flat angle check because I wanted to be able to aim vertically and shoot things on the floor/walls/stairs. So, think a few angles side to side, but any vertical angle. If you don't plan to add it, any advice on the easiest way for me to do it?

    Thanks! Love TPC, saving me tons of work on other areas.
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Instead of changing the name from Mouse X/Y to Right Joystick X/Y you could change the input used within the Constants file. If you remove all instances of Mouse X/Y then you'll no longer need to override GetAxisRaw.

    This next update doesn't add it but it'll make it a lot easier. I've reworked how the character determines its aim direction and you'll now be able to override the TargetLookDirection SharedVariable. This will then allow you to either change CameraMonitor.SharedMethod_TargetLookDirection or completely implement a new version of it:

    Code (CSharp):
    1.         /// <summary>
    2.         /// Returns the direction that the agent is looking.
    3.         /// </summary>
    4.         /// <param name="applyRecoil">Should the target ray take into account any recoil?</param>
    5.         /// <returns>The direction that the agent is looking.</returns>
    6.         public Vector3 SharedMethod_TargetLookDirection(bool applyRecoil)
    7.         {
    8.             // If the transform is null then return the forward direction.
    9.             if (m_TargetTransform == null) {
    10.                 return m_Transform.forward;
    11.             }
    12.  
    13.             return (m_TargetTransform.position - m_Transform.position).normalized;
    14.         }
    Glad you're enjoying it!
     
  26. Fraust

    Fraust

    Joined:
    Jul 2, 2012
    Posts:
    16
    Add another vote! Maybe then I don't need to worry about grenades too much.
     
  27. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    +1 for grenade trajectory or any thrown object trajectory. Great idea.
     
    Arganth likes this.
  28. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Update: after integrating cf in less than 5 mins and realizing it already has everything I'm trying to do I'm like why bother...lol.
     
    Last edited: Aug 14, 2016
  29. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    1.4.1.PNG

    I haven't ran any performance tests on Control Freak but you're probably pretty safe to use it. Input doesn't take much processing so I'd be surprised if it causes a bottleneck.
     
    Gametyme likes this.
  30. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I just wanted to say great job on the fading character in the latest version. It works perfectly and makes the game play experience so much better.
     
    opsive likes this.
  31. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Cookable grenades. Anyone else think this would be a good feature?
     
  32. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I would think this is more a game feature rather than a controller feature.
     
  33. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    There already is a grenade item, it would be useful to have an option to cook the grenade since this is common functionality for such a weapon. Trajectories would be nice but there are already many such assets available, quite unnecessary, an integration would be more appropriate.
     
  34. EvilGremlin

    EvilGremlin

    Joined:
    Aug 12, 2016
    Posts:
    231
    Does TPC have an option to interpolate mousemovement over time to apply smoothing delta (see realistic FPS prefab for an example)? In the demos aiming is really stiff. I like all of the features of TPC, except aiming just doesn't feel right in any of the demos. I hope this can be adjusted, or is just a product of the web player or something.
     
    Last edited: Aug 16, 2016
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    I've added it to my todo list :)
     
    Hamesh81 likes this.
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    With RFPS are you referring to the SmoothMouseLook component? The Third Person Controller uses Unity's input manager for input so you could adjust the sensitivity there. We've spent some time to polish the Third Person Controller for the Deathmatch AI Kit - when we post the deathmatch demo (hopefully today) let me know if you still think that it's stiff. When the character goes into aiming mode there is a separate rotation speed which was jacked up really high so that's probably where the stiffness is coming from.
     
    EvilGremlin and TeagansDad like this.
  37. EvilGremlin

    EvilGremlin

    Joined:
    Aug 12, 2016
    Posts:
    231
    Okay, great. I will check it out. I am not familiar with Unity (just getting started with it). I didn't realize it had a built in look smoothing feature. Thanks for the reply. I will definitely keep an eye out for the deathmatch AI kit. Is that a TPC kit or BD?
     
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    It'll require both :)
     
  39. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    hey,
    i just tried the TPC with puppetmaster and in the integration demo scene. actually the characters jumping behavior is super weird. he performs a double jump and overall the jumping looks not natural since he is kinda "floating" .
    it can be fixed by setting behaviour puppet from active to kinematic but that will mean i loose the whole puppetmaster stuff. but also there the landing looks not natural anymore
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    This sounds related to this post: http://forum.unity3d.com/threads/th...-mobile-framework.292541/page-49#post-2723890
     
    Der_Kevin likes this.
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Version 1.3.3 of the Third Person Controller has been released on the Asset Store. You can see the full change list in this post. This release was a big polish release and is the base version for the Deathmatch AI Kit (just submitted!)
     
    Hamesh81, TonyLi and TeagansDad like this.
  42. g-hoot

    g-hoot

    Joined:
    Apr 18, 2015
    Posts:
    69
    Hello all. Thinking about purchasing the Third Person Controller since it has multiplayer support. I noticed that is says this in the specs on the store "Height Change (Crouch, Crawl)". My question is, does it also have prone?
    Thanks,
    Gary
     
  43. opsive

    opsive

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

    It does not, though a prone position has been on my todo list. Prone wouldn't take much (if any) modification of the Height Change ability though, mostly it's a matter of having the animations.
     
    g-hoot likes this.
  44. Artificialized

    Artificialized

    Joined:
    Oct 5, 2014
    Posts:
    69
    Hello Opsive, How have you been?

    Been a bit since i dug into Your Amazing Third Person Controller :eek: just came here to ask a quick question nothing to serious but when my Blender character runs in my unity 5.4 scene i have used the same character previously about 6-8 months back give or take a month or so and now when my character runs there's these little grey bones that stick out the back of my characters shoes i believe there bones well atleast they look like them and they seem to only appear when running or jumping.Ill try to post a screenshot in a minute just curious to see if its a known unity bug or im doing something wrong.
     
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    I'm curious to a screenshot - I haven't seen what you're describing before. It almost sounds like something is extruding from your character's mesh.
     
  46. Artificialized

    Artificialized

    Joined:
    Oct 5, 2014
    Posts:
    69
    Here's an screenshot if you look closely youll see 2 silverish shiny things extruding from the back of my characters feet when running/jumping doesn't happen at all when walking though :eek:


     
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    That's definitely part of the mesh extruding. Just curious, have you tried other characters for comparison? Are all of the bones mapped properly?
     
  48. Artificialized

    Artificialized

    Joined:
    Oct 5, 2014
    Posts:
    69
    Yes ive tried other characters previously and had no problem ive even used the same character im using now about 6-8 months ago give or take and no problem i did notice the 3d Artist edited the model i used previously and updated it recently :/ it looks like the bones are extruding from the armature when my character run's/or jumps i believe all the bones are mapped properly i went into blender and did notice the feet bones stick out from the feet a bit but not in the back only up front by the toes.

    Just tried it with a previous version of my character doesn't seem to happen to him :/
     
    Last edited: Aug 25, 2016
  49. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    What is the bone weights setting in the Unity quality settings? One or two bones can get really bad results like that
     
  50. Artificialized

    Artificialized

    Joined:
    Oct 5, 2014
    Posts:
    69
    Heres a screenshot of what i have setup as default

     
Thread Status:
Not open for further replies.