Search Unity

Third person cover controller

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

  1. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    hi , the shield + pistol idle stats makes the legs jerk a little when he stops after moving , did i screw something or is this a known bug ?
    thanks in advance .
     
  2. satchell

    satchell

    Joined:
    Jul 2, 2014
    Posts:
    62
    Can you provide a little more info? Double checked with another model or check the original Tank character?
     
    Last edited: Nov 27, 2018
    f1chris and Rahd like this.
  3. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    460
    yes that my animation bug. I have fixed animation
     
    satchell and Rahd like this.
  4. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    460
    plan is 15 of December
     
  5. Alexey1B

    Alexey1B

    Joined:
    May 15, 2017
    Posts:
    26
    Hi, also minor fix for HitEffect - hardcoded GameObject.Destroy(effect, 4) change to use DestroyAfter
     
  6. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    E̶d̶u̶a̶r̶d̶a̶s̶F̶u̶n̶k̶a̶ ̶ ̶t̶r̶i̶e̶d̶ ̶a̶d̶d̶i̶n̶g̶ ̶t̶h̶e̶ ̶d̶u̶a̶l̶ ̶p̶i̶s̶t̶o̶l̶s̶ ̶:̶(̶ ̶n̶o̶ ̶l̶u̶c̶k̶ ̶.̶ ̶d̶i̶d̶ ̶y̶o̶u̶ ̶f̶i̶n̶i̶s̶h̶ ̶t̶h̶e̶ ̶a̶n̶i̶m̶a̶t̶i̶o̶n̶s̶ ̶?̶ ̶w̶o̶u̶l̶d̶ ̶g̶r̶e̶a̶t̶l̶y̶ ̶a̶p̶p̶r̶e̶c̶i̶a̶t̶e̶ ̶i̶f̶ ̶y̶o̶u̶ ̶c̶o̶u̶l̶d̶ ̶s̶h̶a̶r̶e̶ ̶t̶h̶e̶m̶ ̶o̶n̶ ̶g̶i̶t̶h̶u̶b̶ ̶.̶ ̶c̶h̶e̶e̶r̶s̶
    Edit yeah found them , thank anyways
     
  7. Ctttdaddy

    Ctttdaddy

    Joined:
    Mar 17, 2015
    Posts:
    47
    I went over your tutorials and updated your asset just in case but I have no Auto IK button in the Motor controller. I cant follow the tutorial. What's up with the tutorial having things I don't in my DL of the product?
     
  8. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    251
    Can you post a hotfix ? Or just point me to which commit in your Patreon ?

    Thx
     
  9. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    241
    This is now automatic. That's an older video you followed
     
    satchell likes this.
  10. Ctttdaddy

    Ctttdaddy

    Joined:
    Mar 17, 2015
    Posts:
    47
    Where is the new video? I followed the one in the pdf and the Link on the asset...
     
  11. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    460
    I made new series of videos on my chanel. Starting with this video.

    Btw do you want a refund?
     
    jnbbender, Ctttdaddy and Rahd like this.
  12. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    460
    curenlty attached animation is from a walk. it was just for testing.
    I forgot to replace with PistolShield_Idle_002 also added new one couple mins ago. Animation name: Pistol_Shield_idle
     
    redoxoder, Rahd and f1chris like this.
  13. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    Thank you , good luck with the nodes it's looks cool how the brain works now !!
     
  14. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    122
  15. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,416
    I have just tried the demo scene, but the character does not move.? I am using Unity 2018.3.b11

    It plays walking and running animation, but it just stays in the original spot. This happens for all demo scenes, even after reimporting the asset.
     
    Last edited: Nov 29, 2018
  16. satchell

    satchell

    Joined:
    Jul 2, 2014
    Posts:
    62
    If you go back to page 26 @Paul-Swanson posted a fix.
    I checked this on 2018.3.0b8 and found I had the same issue. I check the player character and noticed that root motion was unchecked on him. Simply check that again and you'll be golden.
     
    Paul-Swanson likes this.
  17. Ctttdaddy

    Ctttdaddy

    Joined:
    Mar 17, 2015
    Posts:
    47
    Hello, I imported my model and going through the Tutorial on adding a pistol but when I look down and his arm straightens, his elbows start to rotate backwards... It looks like there is no maximum rotation on the joint before he begins to bend his body. How can I resolve this?
     
  18. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    85
    Hello there! I am facing a small issue with my Player character. My character automatically rotates to some other direction when I go to play mode.

    Screenshot with Play mode off:
    1.PNG

    Screenshot when I hit play:
    2.PNG

    Am I the only one facing this problem???
    Any fix?
     
  19. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    241
    No it happens to me. I'm not sure how its assigning the direction on start. I thought it was the camera...it's not. And it's certainly not the editor rotation of the player...so I'm puzzled too. It may be the animations that's my next guess
     
  20. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    85
    No it's not animation. I tried disabling animator and no success. One thing I am sure about is that CharacterMotor.cs script is doing this. Try manually rotating your character while in play mode and it won't allow you but when you disable character motor script and try it again, it does rotate, so, CharacterMotor script is the one doing this.
     
  21. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    you created a prefab on runtime ?
    fix , look for body.lookat(target) ; in motor
    and replace target with a fake cube transform

    i will write you a script later sorry for the broken code .
     
    satchell and SteveB like this.
  22. VENOMOUS09

    VENOMOUS09

    Joined:
    Dec 27, 2014
    Posts:
    37
    i just bought this today, :)
     
    Rahd likes this.
  23. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    284
    @EduardasFunka Just out of curiosity. How thoroughly do you watch this thread? There are some really good ideas here and super simple things you can modify slightly to make this asset more power/flexible. Do you incorporate many?

    EDIT: I should REALLY say, do you watch this thread for code?
     
    Last edited: Nov 30, 2018
    Lay84 and SteveB like this.
  24. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    Gameobject target ; // this can be an object in the direction you want to be facing .

    this code can be put in mobilecontroller or third controller
    public void lookat(){
    var targetpos = target.transform.position ;
    _motor.SetBodyTarget(targetpos);
    _motor.SetAimTarget(targetpos);
    }
     
    bwv1056 and satchell like this.
  25. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    284
    My environment is a close shooter, i.e. not outdoors. There are many pros and cons to this asset but one of its strong suits is its Camera. Well, my player was up against a wall, camera was close behind and when you aim - the camera clips through the head, readjusts and clips through walls. :confused: Now it's time for some sharing :D
    If I could just get the camera to NOT zoom when it's so close - well some simple adjustments.

    1. To the ThirdPersonController.cs script add
    Code (CSharp):
    1.    
    2. /// <summary>
    3. /// Sets the controller to block the ability to zoom.
    4. /// </summary>
    5. [HideInInspector]
    6. public bool BlockZoom;
    7.  
    Go to the `checkZoom()` method and add the following as the very first lines
    Code (CSharp):
    1.  
    2. if (BlockZoom)
    3. {
    4.     return;
    5. }
    6.  
    2. To the ThirdPersonCamera.cs script add
    Code (CSharp):
    1.    
    2.         [Tooltip("Defines how close the camera can get to the player before the camera will not aim.")]
    3.         [Range(1, 3)]
    4.         public float AimConstraint = 1.5f
    5.  
    Then down around line 347 where he checks for `if (Target != null)` use the controller reference and add the lines
    Code (CSharp):
    1.            
    2. if (Mathf.Abs(controller.transform.position.x - gameObject.transform.position.x) < AimConstraint)
    3. {
    4.     controller.BlockZoom = true;
    5. } else {
    6.     controller.BlockZoom = false;
    7. }
    8.  
    Now when you're up against the wall, you'll still see just the back of your head and the aim pointer, just no clipping through walls.
    Have fun.
     
  26. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    85
    And with this help, Man you solved lots and lots of issues for me. Thanks bro for your precious help. Working perfectly now. LOVE REACTS. ;););)

    Wanna share how did I do this.

    Created a simple script and added this method (Function) into it:

    public void SetCharacterLookingTarget()
    {
    playerCharacter.GetComponent<CharacterMotor>().SetBodyTarget(target.position);
    playerCharacter.GetComponent<CharacterMotor>().SetAimTarget(target.position);
    }

    I used playerCharacter as it was easy for me to get reference of CharacterMotor script. And target is the object I wanna look at.

    Now all I did is call that method SetCharacterLookingTarget(); from anywhere.

    Thanks to @Rahd for his great help.
     
  27. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,416
    I am having far too many issues with this asset for 2018.3 I need to ask refund unfortunately.
     
  28. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    85
    Share your issues here and almost all of your issue will be fixed.
     
  29. 4bab0u4

    4bab0u4

    Joined:
    Jul 6, 2015
    Posts:
    3
    Hey, I'm trying myself to set my controller but I'm getting trouble for the "GetAxis" aspect of it.

    How do you manage to shoot and aim with the back trigger of the controller ?

    Thx :)
     
  30. timinal

    timinal

    Joined:
    Jul 19, 2012
    Posts:
    22
    Thanks for pointing that out. I took Umair21's code and simplified it even more, just attach this script to the Player (no need for a separate target object):

    public class SetStartRotation : MonoBehaviour
    {
    void Awake ()
    {
    gameObject.GetComponent<CharacterMotor>().SetBodyTarget(transform.position + transform.forward*1);
    gameObject.GetComponent<CharacterMotor>().SetAimTarget(transform.position + transform.forward*1);
    }
    }

    Now to find out how to always place the camera behind the player on start...
     
    satchell likes this.
  31. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    177
    does this template support lightweight render pipeline ? :O
     
  32. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    241
    Well your likely going to replace everything with your own assets right? There's nothing special with shaders here so it should be fine.
     
    lolclol likes this.
  33. 4bab0u4

    4bab0u4

    Joined:
    Jul 6, 2015
    Posts:
    3
    Hi @EduardasFunka !
    I'm trying to adapte your plugin for an xbox controller. So far it was ok but I'm having trouble :

    I'm trying to aim with the left trigger of the controller and then shoot with the right one.

    I tried to change a bit the code or at least add a few lines in order to fix my issue, but the thing is that "get axis" is not returning a bool. It's returning a float.. It seems that triggers behind the controller cannot be considered just as buttons.

    Have you a fix for that ?

    Also, I'm trying to change the "crouch" feature in order that you don't have to hold a button. Like on/off kind of stuff. How can I manage to do that ?

    Anyway, lot's of questions I know but your plugin is really great and I really want to go deeper into it :)

    Thx in advance,

    JB
     
    SteveB likes this.
  34. gsmax

    gsmax

    Joined:
    Jun 12, 2018
    Posts:
    10
    Weapons no longer leave the holster when equipped. Is this a bug or an intentional update ??

    Does anyone have a fix to the endless armo and an option to replenish with pickups??
     
    4bab0u4 likes this.
  35. 4bab0u4

    4bab0u4

    Joined:
    Jul 6, 2015
    Posts:
    3
    I would be curious how to manage pickup items as well..
     
  36. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    upload_2018-12-3_20-5-21.png
    here you can edit the ammo it's set to 10K by default
    Holster check if the gun holster prefab is there fo each gun
    upload_2018-12-3_20-6-25.png


    1- create a Cube
    2- add a trigger collider to it , example a sphere that is bigger than the cube
    3- create a script called ammo
    in it add this
    public int AmmoboxBullets = 100; // this is the ammo in the box
    private void OnTriggerStay(Collider other)
    {
    if (other.GetComponent<CharacterMotor>()) {

    if(other.GetComponent<CharacterMotor>().ActiveWeapon.Gun){

    other.GetComponent<CharacterMotor>().ActiveWeapon.Gun.BulletInventory = other.GetComponent<CharacterMotor>().ActiveWeapon.Gun.BulletInventory +AmmoboxBullets ;

    Destroy(gameObject);
    }
    }

    }
    i did not test it , but it should work
    i wish that the dev adds inventory pro integration , or create an inventory system
    but the reality is inventory is hard . example i started working on inventory pro integration , an asset that have been around for years .... only to discover game breaking Bugs and exploits playes can use .
     
  37. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,118
    I need an enemy to go to one point in the scene (stopping attack or any other state)
    Please Rahd, could you help in how to do this?
     
  38. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    I'm working on it Still buggy on the Ai state , can't wrap my head around it :( so far i manged to tell the AI go to a point in the map , but as soon as he finish getting there he will remember the last target and go back attacking , the only way so far to prevent him from doing that is setting the actor id to the same as the enemy , but that will open a can of worms
    i will post it soon just remind me in a week , Don't worry i will have to do it because i need it for my game too.
    i think EduardasFunka is working on the nodes and that will open endless options including go to one point in the scene (stopping attack or any other state)
     
    angel_m likes this.
  39. timinal

    timinal

    Joined:
    Jul 19, 2012
    Posts:
    22
    Hi Rahd,

    What problems did you have with trying to integrate Inventory Pro?

    I have integrated it, and most of what I want to do seems to be working well. Although the code is very specific to my game and the code is not always that clean...
     
  40. timinal

    timinal

    Joined:
    Jul 19, 2012
    Posts:
    22
    @EduardasFunka : I don't know if it is supposed to be like this or if it is a bug, but when the player is armed with a melee weapon pressing the crouch button only changes the camera angle but there's no crouch animation.
     
  41. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229

    exploits like this , the dev will fix it soon
    so the boots need stats to be equipped
    and the axe gives those stats bonus
    so if you unequip it the boots will stay even you dont meet the stats
    my fix was to drop it if the bag is full
     
  42. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    173
    better AI state control have been requested for so long. We can do some cool stuff already but it's hard to control behavior like we wish. eduardas should resolve this soon i guess, he have done so much so far
     
  43. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    241
    Anyone figured how to disable player movement or camera movement when a menu is opened? I know how to freeze time scale...but just not sure how to press say z and have a menu open where using the mouse won't instantly give focus back to the camera **edit** forgot to add this part -- on Click

    Soon as you press anything mouse related it gives control right back to the player\camera
     
    Last edited: Dec 5, 2018
  44. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    284
    Not 100% sure what you want, it's bed time, but look at the MouseLock.cs script on the camera. Add another condition which will lock the cursor instead of just GetMouseButtonDown(0)
     
  45. gsmax

    gsmax

    Joined:
    Jun 12, 2018
    Posts:
    10
    Yes the gun holster prefab is there for each gun, but when equipped the gun doesn't vanish from the holster.
     
  46. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    weird it works on my end , check again if it's not double like there's 2 prefabs on top of each other i did that mistake like alot :D :D , and try a new clean project , last option Email the dev he will answer for sure .
     
  47. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    460
    HI,
    We had this bug in the previous version. update asset.
     
    Rahd likes this.
  48. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    229
    make a script and in it put this
    public " replace this with camera script example Mobilecamera" Camera ;
    public *third-person-cover input replace with the correct name* input ;

    public void Disableenableformenu (bool Enable_disable)
    {
    Camera.enable= Enable_disable;
    input .enable = Enable_disable;

    }


    you can disable with calling Disableenableformenu(false);
    enable with Disableenableformenu(true);

    i'm on my phone will update code later .
     
    satchell and Paul-Swanson like this.
  49. rrabassa

    rrabassa

    Joined:
    Jul 17, 2013
    Posts:
    170
    Hello!

    I'd like to have multiple Death animations for the Player and select which to play depending on how the Player was killed (killed by AI, killed by trap, killed by something else...) Any Guidance?

    thanks,
    rich
     
  50. satchell

    satchell

    Joined:
    Jul 2, 2014
    Posts:
    62
    I would look at Animator controller tutorials. I think adding parameters, as bools, then in your script trigger the bool true.

    Screen Shot 2018-12-05 at 11.10.17 PM.png Screen Shot 2018-12-05 at 11.08.01 PM.png



    Hope this helps.

    EDIT: Within the CharacterMotor.cs on line 6244 is the bool to set the dead animation in the animator true. So I'm thinking adding if's to go through different deaths for each new death Animation you add to the Animator Controller.

    For the if you may look at a BoxCollider as a zone to == true inside or something.
     
    Last edited: Dec 6, 2018