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

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    If you could send me a repro scene that would be great. I can take a look at that stop ability issue as well. One thing to narrow it down would be to remove the short climb ability to see if your character continues to run like that.
     
    mattis89 and gferrari like this.
  2. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hey! What is this? how can it be null?

    NullReferenceException: Object reference not set to an instance of an object
    Opsive.ThirdPersonController.Integration.FinalIK.FinalIKControllerBridge.Start () (at Assets/Third Person Controller/Integrations/FinalIK/FinalIKControllerBridge.cs:99)
     
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Looks like you don't have AimIK from FinalIK on your character. Once you add that you should be good to go.
     
  4. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I fix my issue about the forever running. I change the order of the abilities and it work! Thank you!
     
    opsive likes this.
  5. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Sorry, I don't understand where exactly we can control the character speed.

    What I'm trying to accomplish seems pretty straight-forward: Ethan starts walking slowly, gets to running speed in the middle of the path and then slows down again as he approached the target. Do you happen to have an example scene that includes this functionality?
     
  6. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Ah I must have it on.. okay.. thanks :)
     
  7. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Okay yes it works.. I added aimIk and it looked weird when I aimed (only have fist and sword) then I added lookIk it got better but when I aim with fists he twists his head a bit and bends the body backward.. maybe it only ment for bow and guns? I can see that the aim ik sight line is handled thrue controller bridge since it draws the pink line straight from the left hand when I aim, correct? (Havent set up anything on the AimIk component since in the demo it wasnt neither) must it be right hand when my hero is right handed?
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    If you're using root motion the speed of the character is determined by the speed of the animations. In the default Movement blend tree there are a set of walk and run animations. When the input value is greater than 1 the run animations will play - and this is what the speed change ability does. It sets the input value to 2 by default so the run animations will play. In the BD/TPC demo scene the character will walk when patrolling, and if he gets shot at the speed change ability will activate so he runs.

    Hopefully this help explains how it works!
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    That sounds like a FinalIK configuration issue. I'm not an expert in FinalIK but it looks like this video describes the setup process:
     
  10. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Okay I see.. I just tought somehow that thr bridge took care of that setup.. I have had it working before with some "from scratch" fps I made, but I just dont like the way it handels where the character looks.. I mean the aim target and such.. Its the placement of the empty gameobject thats bothers me.. :D I have to take a look, I sure figures it .
     
  11. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Justin, thank you for the explanation. So is it possible, with BD/TPC, to have Ethan moving at smoothly variable speed? For example, start at 1 m/sec, then gradually increase to 3 m/sec, etc.?
     
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Yes - If you change the Horizontal/Forward Input Damping Time on the Animator Monitor then the parameter will take longer to change to that value which will make the change more gradual.
     
  13. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I've been messing with the swimming system for the last couple of days and it is going to drive me insane at this rate. We have a system with oceans and the character could fall into it at almost any time. For some reason we keep having the character 'fall through' the plane we are using for the ocean height. Also, any tall waves will exceed the buoyancy speed of the character and they, again, fall through the water. Is there a different swimming/diving set of abilities? Or a set that is a bit more suited to large waves/oceans rather than limited pools?
     
  14. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72
    Hello, I have a huge integration problem. I'm using a traffic system that uses triggers and raycasting to make the cars and pedestrians move. As expected Third Person Controller Player is hitting those triggers and being obstructed by them. I cannot change the layer to IgnoreRaycast as the traffic system need those triggers to be on specific layers to work, and also I cannot disable raycasting to be detected on those layers as the traffic system uses raycasting.
    How could I configure Third Person Controller to ignore those triggers?
     
  15. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72
    I'm also having issues integrating with Dialogue System:





    Do you have any idea what could be causing this issue?

    Regards
     
  16. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Is there some Opsive chat where you can ask and learn? type a Slack channel? I saw other assets doing that and it is very good to help each other.

    I have a question, my character only uses the bow. I would like when he walks or runs, he does not have it in his hand, I want he always carries it on his back and only pulls out when he presses the Fire button. Is there any way to do that?

    upload_2017-12-18_22-8-59.png
    upload_2017-12-18_22-9-21.png

     
    magique likes this.
  17. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I was able to reproduce my error in the demo of the third person shooter!, We have to go here, it is a vertex between the object climb and another object. If you press action, it remains running or blocked.

    upload_2017-12-18_23-46-15.png

    upload_2017-12-18_23-48-40.png
     
  18. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @gferrari - your best bet are the Opsive forums. There is an unofficial TPC slack channel, but it was more or less dead last time I looked at it.
     
    opsive and gferrari like this.
  19. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Thanks! That works nicely. There's a little problem with Ethan overshooting the targets because he can't stop right away, but that's not a big deal :)

    I have a related question. Let's say I want Ethan (as an NPC) to travel between several waypoints with different speeds without stopping at each waypoint. For example A to B speed=1 m/sec, B to C speed=2 m/sec, C to D speed=5 m/sec and so on. How can this be done?
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    The current implementation uses Unity's water system which just uses a flat plane and does not have any waves. I'd like to add integration with other water assets to be able to support this but it won't be until after we release version 2
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Take a look at the LayerManager - within this class it defines what is considered the ground and you can add/remove what layers are affected by it. I keep meaning to add this but you can overload the raycast methods so it'll automatically ignore the layers and I'll do that in the next release which will be when Unity releases Unity 2017.3 (which sounds like it'll be this week).

    Hmm, are you able to reproduce it within the Dialogue System sample scene? The error points to the camera being destroyed but from your video it looks like it loses input and not destroyed. @TonyLi, do you have any ideas?
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    As @TeagansDad mentioned, there used to be an official Slack group but I think it's mostly dead. The opsive forums are a great place to post because you can search for previously asked questions so I recommend that over the Unity forums.

    That'll take a new ability. When the Fire1 button is head down you call Inventory.EquipItem to do the equip, otherwise Inventory.UnequipCurrentItem will unequip the weapon.

    Thanks - I was able to reproduce it! It does look like it's something related to short climb. I'll have a fix in the release this week.
     
    gferrari likes this.
  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    This will require modification to the patrol task. Within the patrol task you'll need to modify the Horizontal/Forward Input parameters based upon which patrol index the character is at. You can also change how close the agent is considered to be arrived so the agent moves onto the next waypoint without stopping.
     
  24. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hey! You told me rewired is used for split screen? Does control freak 2 work the same way?

    Budget n so :D
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    I replied in the Dialogue System thread. I think @Galahad just needed to go through the integration steps.
     
    Galahad and opsive like this.
  26. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    I always thought that Control Freak was just for touch controls but I just checked and it looks like it supports controllers as well. I haven't used that aspect of Control Freak so I would ask the developer how well Control Freak supports multiple controllers.
     
    mattis89 likes this.
  27. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72
    Thank you very much @opsive, I'll try play around with LayerManager and se what I can do. @TonyLi gave very detailed directions on Dialogue System thread, I think I'll manage to deal with it easily now.
     
  28. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    @opsive I noticed that when I use character builder to build my second character to use by player 2 in split screen, it has the same tag and layer, does it affect the gameplay somehow? Should I change it? .. and it uses the same anim controller as I player 1 ( wich I have customized).. But I guess I could just swap that one to the default right? Or should I have must choosen some other like "combat" when I built player 2? :)

    EDIT: I bought Rewired tough. Works really good. Have both characters running and jumping.. or not running yet. Have to make a new action in rewired.. pretty forward..and then map the button. It wasnt all setup even that it should been intergrated.

    The thing tough when I use aim with the controller it also zooms player 1? I have set that player 1 is keyboard/mouse bound. Shouldnt bee affected?
     
    Last edited: Dec 20, 2017
  29. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151

    There is a holser target where you have the weapon settings... so when you hit T or just change to some other weapon he holsters it .I wish I could show how I have it :D
     
  30. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151

    I have no idea with this "Look at or aim" .. Everytime I use my sword his left hand is left twisted.....I deleted the bridge.. And made my own set up containing only FBBIK & GFBBIK .. It was the grounder I wanted =) ... Look at gives life but.. I dont have good target solution..Dont know what I could use...If my character would have Xena with him he could just stare at her :D xD
     
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    The CameraHandler uses the PlayerInput from the camera so as long as that is setup to use the Rewired bridge component you shouldn't have a conflict. You can double check this by taking a look at CameraHandler.Update and seeing if GetButton is returning the values you'd expect.

    If you can tell me how to reproduce it or send me a repro scene I should be able to take a look at the bridge component.
     
  32. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Use a Mixamo character. Set it up like an adventurer.. add a sword and fist.. add Final IK bridge... and full body biped IK component. That should reproduce it .. or I can just pack my project and send it over.. =) Not a big deal tough, but would be nice to know the cause =) I couldnt find it .
     
  33. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Okay , It works fine with my first created player, when I aim it dosent affect player 2 screen.. I added the rewired component to the character... should I add it to the camera too? .. Everything seems to work fine overall =) .. The pipe climbing is a pain tough, when both characters climb, it dosent know what the script should do.. you can climb past the terrain ground.. but with one character it works.
     
  34. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    I have two problems.
    the number 1 is is the error I most want to fix.

    1) When my character climbs a ladder in a part of the game map. It does not return to activate the Rigybody, I made another post to explain that with two videos.

    That is just a question, but is not important right now.

    I decided to try two other characters, they are gigant and the mesh is in -90 grades :/, so I tried to change its size but it starts to have inconveniences with the camera and it gives me a bug when the player use the hang ability

    Assertion failed: Screen position out of view frustum (screen pos 640.000000, 410.000000) (Camera rect 0 0 1280 800)
    UnityEngine.Camera:ScreenPointToRay(Vector3)
    Opsive.ThirdPersonController.CameraMonitor:UpdateTargetLookRay(Boolean) (at Assets/Third Person Controller/Scripts/Camera/CameraMonitor.cs:147)
    Opsive.ThirdPersonController.CameraMonitor:FixedUpdate() (at Assets/Third Person Controller/Scripts/Camera/CameraMonitor.cs:125)

    Any ideas? Thank you!
    Any of the two that I could solve would be great (The first character had everything set up, and everything is perfect, but have that issue...)

    upload_2017-12-20_20-18-14.png
     

    Attached Files:

    Last edited: Dec 21, 2017
  35. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Where exactly would I find the "Horizontal/Forward Input parameters"? Since this is an NPC, I assume not in the Input Manager. I guess I'm missing something obvious here :)
     
  36. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    It depends what asset you using for npc. Or if you have coded itself. Overall they use to be in the animator..root or coded based mathers too.
     
  37. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    1. You have to set offset/values based on your character for climbing and swimming. Copy is just for getting the chopped meat but you have to cook it too :D

    2.. the camera thing is not a bug. Your character sounds its not made to fit in unitys metric system so when you change its size the otpc cameramonitor gets confused and throws the camera away and then the camera dosent 'see' the hero. Try change the mesh/character size before building the character.
     
  38. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Look how strange of this. If I start the game from the beginning of the map the error always happens (last seconds of the first video), the character climbs the ladder but does not activate the gravity, but if I start from before diving as in the second video, it works well every time. Is it a bug? A bad configuration? What could it be?. Temporarily solve it with a trigger that activates gravity.

    First video

    Second video
     
    Last edited: Dec 21, 2017
  39. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Its some small configuration error probably.. Why do you have 2 "red get off" planes on the ladder? I started yesterday with climbing so.. Cant really say.. But it dosent seem like something serious just tricky to find..

    What have you made the cutscene with? :)
     
  40. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Does the order matthers? :O
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Is the AimIK target in the correct position? If it's too close to the character then you can to increase the look distance on the camera monitor. Beyond that if you can send a repro scene that would be great (support@opsive.com).
    You don't need the component on the camera. If you step into CameraHandler.Update is GetButton returning the correct value? The PlayerInput reference should be pointing to the RewiredInput component which is set to a different player id for each character.
     
    Last edited: Dec 21, 2017
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    You can do this by changing the Horizontal/Forward Input damping time on the AnimatorMonitor. This will change the acceleration rate while using root motion.
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Are you able to reproduce it or send me a repro scene? I just tried swimming and then climbing the ladder in the clean scene and wasn't able to trigger that same behavior. It could be related to the ability priority so make sure you have a similar order as what is in the clean scene:

    priority.PNG
     
  44. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Justin, thank you for the response, but I think there's some confusion because I asked two somewhat similar questions. This answer works for my first question, but not for the second one. Here it is again:

    "I have a related question. Let's say I want Ethan (as an NPC) to travel between several waypoints with different speeds without stopping at each waypoint. For example A to B speed=1 m/sec, B to C speed=2 m/sec, C to D speed=5 m/sec and so on. How can this be done?"

    You answered:
    "This will require modification to the patrol task. Within the patrol task you'll need to modify the Horizontal/Forward Input parameters based upon which patrol index the character is at. You can also change how close the agent is considered to be arrived so the agent moves onto the next waypoint without stopping."

    Then I asked where can I find the "Horizontal/Forward Input parameters" you are referring to.
     
  45. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    138
    Hi. I was wondering if anyone has error message before?

    NetworkIdentity component was found but ENABLE_Multiplayer symbol is not defined. Please define it within the rigidbodycharactercontroller inspector. The source code must be imported for the symbol to be detected.

    I think I've added ENABLE_MULTIPLAYER in the correct spot in the player settings but maybe I've done that wrong. Also I read there was a button on the Rigidbody Character Controller to add it for me but it is not on my version of the script. I'm using the most updated version of the asset.
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    It's on the AnimatorMonitor - you'll want to change the damping value. In order to do this you'll need to modify the Patrol ability to be aware of the AnimatorMonitor and it can then set the damping time based on what waypoint the agent is headed to. If you want to completely change the animation then you'll need to use something like the speed change ability so it can multiply the animator's horizontal/forward input values.
     
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Make sure you've imported the source (step 2 on this page has the link). Without this the compiler definition isn't able to be found.
     
  48. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Manipulating Damp Time values in the Animation Monitor will affect Ethan's acceleration, but we want a constant speed between waypoints. So it looks like we need to use the Speed Change ability?
     
  49. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    That's correct. Personally for that situation I would call RigidbodyCharacterController.TryStartAbility directly within Patrol instead of having a separate speed change task.
     
  50. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    138
    Thank you that worked perfectly.

    One more quick question any info on UFPS2 release and will it have multiplayer support like this once released? I'm dying to test the new one out.
     
Thread Status:
Not open for further replies.