Search Unity

Third person cover controller

Discussion in 'Assets and Asset Store' started by EduardasFunka, May 23, 2017.

  1. Anhella

    Anhella

    Joined:
    Nov 18, 2013
    Posts:
    67
    sorry for inconvenience. errors have been fixed.:D thanks in advance
     
  2. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Hi, @EduardasFunka: Please take your time in designing the final setup for character basic frame (scripts and other components) so no major changes are needed with every update. I followed the new weapons system tutorial, but it didn't work as expected in my case and I had to reconfigure all, manually, step by step.
     
    Camelot63RU and Neviah like this.
  3. DaewonK

    DaewonK

    Joined:
    May 30, 2018
    Posts:
    1
    I want to make top-down shooter with fixed camera angle like Hotline Miami with this asset.
    Making angle fixed top-down view camera is so easy, but then modifying control player is so hard, because scripts about inputs and control are too complicated and too interdependent with other components to modify.
    I like cover system and AI of enemies so much, just want to change only camera and control. could anyone help me?
     
  4. uni7y

    uni7y

    Joined:
    Jul 23, 2012
    Posts:
    287
    @EduardasFunka what happend to your patrons? you went from 4 to only 2 Patrons?! I was planning to become a Patron soon so I'm curious why 2 of them leave.
     
  5. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    so here is a really bad script that i can't understand how i made it :D (lack of sleep)

    the goal is to make bullet ricochets using reflect
    i have no idea why i did those randoms , but probably to reduce the chance of 180 angle to the player
    and chance of ricochet.
    here is the interesting part , as you can see in the script i have not wrote any code to detect the wall thickness ...
    but the bullet pass by if it's thin ...
    so my question is how can i isolate this effect so i can make it more special for metal or wood ... ect
    and is this effect a result of using fixedupdate ?
    Script :

    (add it to Projectile script , and add a trigged collider on the projectile"Bullet" )
    (Tag check "rock" is to make sure that it will happen only on objects that will reflect bullets..)

    rikochet is an offset to the bullet distance so it wont die before reflecting

    origine is that source of the bullet "Gun" you can set this in gun.cs under fire() , just add projectile.origine = Origin;

    Code (CSharp):
    1. public float  rikochet = 5;
    2.         bool hasbonced=false ;
    3.         public Vector3 origine;
    4.  
    5.  
    6.         private void OnTriggerEnter(Collider other)
    7.         {  
    8.  
    9.  
    10.    
    11.             if (other.tag == "rock") {
    12.            
    13.             if (hasbonced ) {
    14.                 GameObject.Destroy(gameObject);
    15.             } else {
    16.  
    17.                     RaycastHit hit;
    18.                     if (Physics.Raycast (origine, Direction,out hit)) {
    19.  
    20.  
    21.                         var inDirection =   Vector3.Reflect(Direction, hit.normal);
    22.  
    23.                         float chancerandom = Random.Range(0, 180);
    24.                         if(chancerandom > Vector3.Angle ( Direction  , inDirection)-30 &&chancerandom < Vector3.Angle ( Direction  , inDirection)  +30 && Vector3.Angle ( Direction  , inDirection) <170)  {
    25.  
    26.  
    27.  
    28.                             Debug.Log (Vector3.Angle ( Direction  , inDirection));
    29.                             //if (Vector3.Angle ( Direction  , inDirection) >20) {
    30.  
    31.  
    32.                             Direction =    inDirection.normalized  ;
    33.                             transform.position =  Hit.Position ;
    34.                             transform.LookAt(Direction);
    35.                             Direction.y = Random.Range (- (Direction.y +0.5f),  Direction.y +0.5f);
    36.                             Speed = Speed / Random.Range (2, 4);
    37.                             Distance = Distance - (Random.Range (0, rikochet)) + Random.Range (Hit.Damage*0.05f, Hit.Damage*0.3f);  
    38.                             hasbonced = true;
    39.                             Quaternion rotation = Quaternion.LookRotation(Direction);
    40.                             transform.rotation = rotation;
    41.                             //    } else {
    42.                             //    GameObject.Destroy(gameObject);
    43.                             //}
    44.  
    45.  
    46.  
    47.                         }else {
    48.                             GameObject.Destroy(gameObject);
    49.                         }
    50.  
    51.                     }
    52.  
    53.            
    54.             }  
    55.        
    56.            
    57.            
    58.  
    59.  
    60.             }}
    61.  
     
  6. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Maybe they came just to try new patch.
     
  7. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    Hello,

    I've imported Third Person Cover Controller with success in the past (1.5.1/Unity2017) but now however whenever I import the asset into my fresh projects ( 1.5.1 in 2017 or 2018) I get the following err x7? From a fresh project with only TPCC imported I get this:


    IndexOutOfRangeException: humanBoneId must be between 0 and LastBone
    UnityEngine.Animator.GetBoneTransform (HumanBodyBones humanBoneId) (at C:/buildslave/unity/build/Runtime/Animation/ScriptBindings/Animator.bindings.cs:986)
    CoverShooter.CharacterMotor.Awake () (at Assets/ThirdPersonCoverShooter/Scripts/Character/CharacterMotor.cs:2128)

    I've tried solving this myself but was unable to so I am asking here, any solutions?

    Thanks!
     
    Diskomuz likes this.
  8. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Send me an email will help you with that
     
  9. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61

    Couldn't find an email so I used the conversation option on these forums, is that ok?
     
  10. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    is there a way i could add in staffs to the game? and have them do some kind of elemental damage?
     
  11. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    I am having an unusual issue I was hoping someone could help me out with. I have setup a simple character with a pistol in the Civilian demo Scene. It works just fine. But when I move it to a basic scene with a simple plane the "aiming/zooming" shooting only works when I shoot no higher than about 15 degrees off the ground. Everything else works fine. If I then duplicate then character and move it back into the Demo scene - no problems - when I aim and shoot, it works as expected.

    Any ideas?
     
  12. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    What errors do you get?
     
  13. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    That's the funny thing, I don't get any errors. I tried looking through the code, would seem to be pretty easy to hunt down. Missing layers, a bunch of booleans that kind of thing but couldn't find much.
     
  14. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    tbh, i get really weird errors with the AI when i shoot because the search doesn't work correctly... Although it seems to work a lil better now... It's weird unless you copy and paste that scene that works and see what happens afterwards?
     
  15. CoolMambo

    CoolMambo

    Joined:
    May 21, 2013
    Posts:
    19
    Hey as a new user let me say this asset is amazing and really helped me get my game prototype moving quickly in the right direction. Do you guys have any good ways to add cover to a lot of things at once (like big walls, static objects, cars in the road etc) Adding the cover script on a child object and surrounding the parent object (ie wall) with them is the only way I can seem to get the cover to work.

    edit: also I have the IK aim bug on the left side only with Synty char models.

    As well another bug where my character falls really slow. Cowboy doesnt to do that though.
     
  16. CoolMambo

    CoolMambo

    Joined:
    May 21, 2013
    Posts:
    19
    Another bug. Just updated to unity 2018.2 and started a new project and getting a bug with a fresh TPCS for an issue with bones

    Line 2127 in the CharacterMotor script.
    foreach (HumanBodyBones bone in Enum.GetValues(typeof(HumanBodyBones)))
    _bones[(int)bone] = _animator.GetBoneTransform(bone);

    Throwing error on:
    IndexOutOfRangeException: humanBoneId must be between 0 and LastBone
    UnityEngine.Animator.GetBoneTransform (HumanBodyBones humanBoneId) (at C:/buildslave/unity/build/Runtime/Animation/ScriptBindings/Animator.bindings.cs:986)
    CoverShooter.CharacterMotor.Awake () (at Assets/ThirdPersonCoverShooter/Scripts/Character/CharacterMotor.cs:2130)

    as I said. Fresh project with 0 changes only import of Third Person Cover Shooter. Works on 2018.1

    EDIT: I was able to fix this using the following

    foreach (HumanBodyBones bone in Enum.GetValues(typeof(HumanBodyBones)))
    {
    if (bone.ToString() == "LastBone") continue;
    _bones[(int)bone] = _animator.GetBoneTransform(bone);
    }

    hopefully that last bone isnt needed ;)
     
    Last edited: Aug 4, 2018
    p_hergott and grimcat like this.
  17. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    256
    Quick question to everyone, is there any advantage at to use A* pathfinding for AI ? does it integrate well, do you think you can gain any performance gain or any precision gain for AI ? it look like it wouldn't make much difference, but i don't know anything about it beside the bing and wow of their description.

    Thanks for you light guys
     
  18. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    When is melee coming?
     
  19. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Right now we fixing small bugs and melee has the highest priority.
     
  20. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    Awesome cause i was wondering does this asset allow rigs for creatures? I'm not sure if it would work xD
     
  21. Jhorvath9

    Jhorvath9

    Joined:
    Nov 22, 2015
    Posts:
    9
    Hopefully someone can answer this quick question. I've been looking at this asset for a while mainly from finding the top down cover shooter mobile. However, I was looking to do this with a PC and not mobile and was waiting for full PC controls for the top down portion to be implemented. With the 1.5 trailer, this looked to be the case but I still would like a complete answer on this.

    So is the attached screenshot I've provided showing the top down PC controller from the 1.5 trailer standard when you buy this asset and is for the most part plug and play similarly to the the standard third person cover shooter controller?

    Thanks in advance to anyone who can answer this!
     

    Attached Files:

  22. Camelot63RU

    Camelot63RU

    Joined:
    Jul 20, 2014
    Posts:
    17

    asset not work on 2018.2.2f1
     
  23. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    Hello again,

    I was wondering if someone can help me figure out an issue I'm having with the mouse look functionality.

    I've got my own character moving in all directions with custom weapons, while there's still the awkward twisting while aiming from left cover issue I posted here I'm leaving that be in hopes it gets fixed with the next update (currently 1.5.1).

    My exact issue right now is my character is unable to turn left or right with the mouse. I can move forwards/backwards/left/right, aim, roll and shoot but it's like the camera doesn't take into consideration the mouse input when trying to turn or aim?

    I'm getting 4x warnings in the console related to this that read:
    The referenced script on this Behaviour (Game Object 'Main Camera') is missing!

    I've done over the guides, compared almost everything to the "Third Person Cover" scene where I DO have my custom character working properly in almost all aspects except the weird aiming from left cover where my model's upper half gets twisted.

    Has anybody encountered this issue or does anybody know how to solve this? I've been racking my brain on this specific issue for 2-3 days now just trying to get my character into my world to continue working on my project.

    Here's a video demonstration of this issue.
     
  24. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    when you buy TPCS you will get a scene with pc controls for a top-down view.You can replace characters tweak them and make your own pc game with it.
     
  25. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    send me email will give you new version 1.5.2
     
  26. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    send me an email will give you a new version.
     
  27. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    592
    i want to buy it but i need it for unity 2017.1
     
    Paul-Swanson likes this.
  28. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    @EduardasFunka
    I'm just now coming back to this after a while. I see you've release it for 2017.4 will this still work on 2017.3 or is there some code that is only compatible to 2017.4? If there's no compatability issues I'll just copy it over from a higher version manually. I really don't want to use 2017.4 because of the substance deprecation.
     
  29. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    got the horse animset pro for free today here is how to move the horse....

    go to mobile controller and add this :
    find the input script on the horse and add it to mobile controller , then in the update of mobile controller feed the movement direction to the horse input and call .move using SetInput in horse input
    it's easy to support horse animset pro , both of the devs should make it happen

    more work on mount and aim
     
    Last edited: Aug 11, 2018
  30. Camelot63RU

    Camelot63RU

    Joined:
    Jul 20, 2014
    Posts:
    17
    Hi, do you have any plans for moving around crawling, scrambling over pipes or cornices?
     
  31. Ssssilk

    Ssssilk

    Joined:
    Jul 28, 2014
    Posts:
    12
    Hey @Rahd -

    Would you mind PMing me (or email at itschrislund@gmail.com) - I have a quick question for you and was unable to message you directly (I'd rather not fill up the forum with, as it's unrelated).

    Thanks!
     
  32. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    It shuld work if you will find errors we will fix them
     
  33. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Amazing stuff you doing! Do you have website about your game?
     
  34. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    Is there a way i could get a bug or different rig with animations to work with this framework?
     
  35. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    I'm kind of new to C# / Unity and I can't figure out how to get the Cover Shooter Controller to damage my Emerald AI enemies. I actually have no idea where to start even.

    I've tried going through these forums and trying to call deal() and OnHit() but I'm probably doing this all wrong, can someone help me out here please?
     
  36. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    I don't think it's been integrated yet. Unsure though.
     
  37. FlloriiN91

    FlloriiN91

    Joined:
    Feb 26, 2015
    Posts:
    6
    Hello, can i get an answer on the Top-Down Cover Shooter mobile please? When will be the next update for it too, like for this one, the Third Person Cover Controller 1.5 Patch?
     
  38. deirre

    deirre

    Joined:
    May 5, 2013
    Posts:
    3
    I am also getting this error. Is there a fix for this yet?
     
    Last edited: Aug 25, 2018
  39. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    When is the new update out?
     
  40. Pollawat

    Pollawat

    Joined:
    Aug 27, 2016
    Posts:
    192
    Hello sir, I got a question about "what the script in strategy scene make a character group and walk together?" and "Can we use that to create AI move with us in TPS scene?"
     
  41. Testmobile

    Testmobile

    Joined:
    Jul 3, 2012
    Posts:
    113
    Looks awesome, how did you got the character to stick to the horse?! Im sorry if it's too obvious but i have been trying to get the third person controller to work with the edy car physics (but im kinda retarded when it comes to code) so any tips would be appreciated.
     
  42. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    Yes please...do tell. I'm building a sci fi thing so I need to be able to mount a spacecraft chair.
     
  43. BettoSan

    BettoSan

    Joined:
    Dec 7, 2017
    Posts:
    57
    How can I make HitEffects bullet particles parallel to the wall?
    I noticed the marks on the wall rotated with the camera.
    To give more reality, I put a longer time for them to destroy themselves.
    Does anyone have any ideas to help?
     
  44. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I suggested the author to add basic instructions for IA behaviour such as "go to this point" (I think it would be more useful than other more complex behaviours) but I 'think nothing is made in this respect.
     
  45. redoxoder

    redoxoder

    Joined:
    May 11, 2013
    Posts:
    74
    any news of the update ?? thanks
     
    Camelot63RU likes this.
  46. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Some News

    AI Rushing player and hitting his shield
    meleAI.gif

    Melee Fight
    mele.gif

    You can join Patron and test your self.
     
  47. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    We have those actions you can tell AI where to go. Can be done in Third person view too just need to get hands dirty with code.
     
  48. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160

    It would be nice (and much easier) if we had simple specific functions we could use from any script attached to the AI. For example the AI is attacking the player and when an event occurs (a time event, a player action...etc) the function is called and the AI stops the attack and go to one point.
     
    Last edited: Sep 4, 2018
  49. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    256
    Very cool. Eduardas, it's sometimes hard to get answer or feedback. Delay is long and asset is very complex. Hard coded layer number wasn't the best idea. beware user, you will mostly end up with different layer order and this will cause problem unless you edit the code yourself. I have solve all my issue with the current version of the asset.

    Problem with cover system, there is a limit for the capsule size to be reduce. under a certain size it doesn't work and the character will jump in and out of cover frenetically

    I still have problem with raycast firing as soon as you click

    Unrelated to asset, my "bullet" collide with collider that are set to "trigger" even though i remove the collision between the 2 layers im using... need to investigate that. Can be cool to add toggle for us to select wich layer the raycast shall consider. (even though in my case, the problem is with the actual bullet physic)

    The AI still go crazy with the target "disapear". If they kill a player, that gameobject is set to inactive. You spawn ANOTHER game object, the AI will continue to see the position where the game object was and won't be able to see it so they will just walk like crazy. A check shall be done to verifie if the target is active. If not, the target should be cleared...

    possible improvement for hit effect, have it to be an array with random pick and allow different hit effect for melee and gun and bomb.

    improvement : would be nice that death is ragdoll and explosion trigger ragdoll untill volicity goes under a certain level and then the player stand up.

    I added transition to character motor for "knock down" action. Since you have melee now, it would be a normal transition to have. "chance to knock down" on each melee
     
    Last edited: Sep 4, 2018
  50. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89