Search Unity

Third person cover controller

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

  1. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    That's how we plan: AI, Controller polish, Mobile controls, Multiplayer, then we could do ladders.
     
    MLipscomb and Paul-Swanson like this.
  2. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    First, it is not a bug. Many people told you how to solve your issue. I thought you did. But you came swinging at everyone in a forum. So I offered you a refund. Looks all fair to me.
    Now you bully me with 1-star rating. I DO NOT HELP BULLIES.
    Goodluck.
     
  3. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    I'll try my own shot at ladders then. Do you think that would be possible with the customs actions mentioned earlier in the thread? Or would it be more involved
     
  4. rrabassa

    rrabassa

    Joined:
    Jul 17, 2013
    Posts:
    170
    Is there a way to either trigger an alert to an AI or have the AI become alerted by something other than the player? The scenario I have in mind is the player activates a machine (like an elevator) and the AI hears the machine and switches to sear or investigate more.

    Any ideas?
    Thanks,
    rich
     
  5. rrabassa

    rrabassa

    Joined:
    Jul 17, 2013
    Posts:
    170

    It seems like it should not be too difficult. I have downloaded "climb" animations from Mixamo and I have added additional layers to the animator controller with trigger parameters. The tricky part is making it look good/natural :)
     
  6. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    I think there are 100 ways to make a ladder. You could do simply a predefined cutscene with custom actions.
    If you want different sizes of the ladder then it's harder. Do you want on and off-ladder animations? Do you want to climb up and down with W and S button? Do you want to unequip certain weapons before start climbing and equip on the finish? Do you react to bullets? Can you die while climbing? Can AI follow you or you immune to AI? It's easy to build a ladder system if you have a controller for walking simulator once you have AI guns etc it's getting complicated :) And if you want other people to use those ladders then its even harder.
     
    redoxoder likes this.
  7. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    You can trigger investigate mode.
     
    redoxoder likes this.
  8. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    @umair21
    @EduardasFunka
    calm down both , he did not make a mistake (the dev)
    it's just when you put a new gun the sniper mesh needs to be on the scope layer or whatever ...
    you can even add a code to disable the gun mesh when scoping and enable when not ...how hard is that ?
    i don't use the third person or first .i did not post any code since :A there's a perfectly working code .
    B i only keep mobile scripts.
    and 4-6 pages ago it was answered , and now reviewing the code it works just fine
    your guns is the issue ? i'm not sure
     
    redoxoder likes this.
  9. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Has anyone implemented a pistol laser sight? I noticed the laser script and attached it to my gun/laser mount. Then I added the reference to it in my players Weapons profile. I haven't been able to get this to work. Am I going about this wrong? Has anyone done this successfully?
     
  10. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    I tried that as well. It appears to be a line renderer. I think that was intended for the top down to help direct your aim.
     
  11. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    Not really they don't have support for topdown camera :( , it looks cool
     
  12. rrabassa

    rrabassa

    Joined:
    Jul 17, 2013
    Posts:
    170

    Um... how?
     
  13. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487

    I am having an issue swapping a pistol between the left and right hands. If you look at the fuzzy video, you will see that I have 2 R8 pistols labelled L & R for each hand. I have selected "Prefer Swapping" for this weapon. But when the player turns left against the wall, the R8 - R pistol gets placed in the Left hand. Then when the player switches back to the right, the gun switches back to the right. The issue with this is that I cannot set independent "LowCoverRight" and "TallCoverRight" positions causing the hand positions to look funny when leaning left as shown in the video. It's as if the R8 - L pistol never gets used.
    Look @ around the 30 second mark.
     
  14. Camelot63RU

    Camelot63RU

    Joined:
    Jul 20, 2014
    Posts:
    17
  15. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    chill dude ... more bugs to come :) . you just need to fix them all by yourself Now.
     
    f1chris likes this.
  16. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    LoL! Fixed lots and lots of bugs till now.
    Your answer helped me with the sniper but how the hell cowboy's sniper gets invisible wothout doing anything?
     
  17. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    he doesn't have to this asset is been for a year or more . he keeps fixing and adding stuff to it for free. we even ask him here to add things for free . and you come over here demending like he is your slave .... will not help any of us . let's all cool down and get pass this.
     
  18. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    check out this tutorial:
    (3:50)
    Btw how is the performance for you?
     
  19. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Very funny.
    I guess it's a little better but my GTX 1060, 4.2 Ghz, 32mb is still somewhat jittery on the Tutorial scene. I had to shut off the sand and a few other things while I got setup. I still can't IMAGINE what your using to run Book of the Dead AND Abandoned School House. Invector's performance is still better but your IK is better - sometimes can't even get their IK working. Your system is a cover system so not sure how that effects your performance (Raycasts, etc.). Your camera has gotten better which is a huge plus since this is the first thing TPS should focus their attention on. Since character setup is very time consuming and has many features one thing I wish you would work on is a setup "machine" like all other assets have (Invector, ootii, etc). Setup is WAY too difficult and there are some things you have that can be more automated.
    Anyway, thanks for pointing me to the video. I haven't looked at Rifle or Sniper since I'm not using them. If it doesn't work I'll yell at you ;)

    One more thing, I watched your video about Building a House and I was hoping to see something about attaching Cover scripts and Hit scripts but I didn't see any. It took my a bit to figure out that the character only covered if the collider was in a certain rotation. That kind of thing would've been nice to show.
     
    Last edited: Oct 19, 2018
  20. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    my computer worst than yours. and I can run that scene on medium on my MacBook Pro. Will make a demo for TPCS on mobile next patch.
     
  21. Reiner

    Reiner

    Joined:
    Dec 2, 2012
    Posts:
    214
    hi i have two questions..... first when you think to finished multiplayer for the kit? and any chance to get the unity project file for the tuturial you made without the purchased assets?

    Greetz Reiner
     
  22. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Hi,
    If you want this asset for multiplayer then I advise you to wait. I do not want to promise date that I don't know. what would be the purpose of this project without assets? You will get missing content errors everywhere.
     
  23. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    amazing stuff!
     
  24. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    Check this out.
    Mobile performance of TPCS is smooth and perfect.
    If you feel lag or drop of FPS then there must be something wrong with your environment or models.
    This is the project I am working on, Third Person Story based shooter game.
    And for mobile controls, I am using control freak.

    Device: Samsung J7
    Drawcalls: 500+
    FPS: 150+
    Build size (Without any compression): 70MB.

     
    Neviah and Paul-Swanson like this.
  25. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Ok, I must have something not figured out in terms of performance. BTW, how do you guys get the "sneak-up" kill thing setup?
     
  26. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    Synchronized 2 animations that i got from mixamo, simple.
    Add an extra animation to the animation controller, link it through a trigger or boolean and just turn that bool or trigger to true. That's it. But make sure you add a way back transition from stealth kill animation towards the main walking blend tree.
     
  27. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    That's pretty cool. What did you do to detect proximity to a target?
     
  28. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    dude thank you for that mention !! you saved my life :D
    control freak 2 is super easy and fix the mobile controller !
    you will have to convert the input scripts of cover shooter.
    and then capture input in runtim
    then assign the buttons on the assistance
    at any time never close the assistant only after you have assigned the mouse X-Y to a track pad
     
    lolclol likes this.
  29. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    @EduardasFunka just looking through the gun components, where you have the gun effects script, can you make another separate script called Gun Animation where you can drop in the gun's animator component and then when you fire it makes the trigger call to the gun animator etc.

    There's a lot of gun assets on the store that have animators for the weapon firing, reloading, changing fire mode etc.

    Would be cool to be able to tap into it. I'm not sure if you already have something like that (just checking in after a long time away). If not, I'll make it when I get up to that point and send it to you.
     
  30. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    @EduardasFunka I like the way you've done the character animator. It's very easy to create an animator override controller and replace all the animations. I haven't had to change any transitions or anything yet, just drop everything in and its working so far :)
     
  31. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    @EduardasFunka The method protected virtual void UpdateAttack() in the ThirdPersonInput.cs file accesses the private ThirdPersonController _controller; can you change this to protected. Otherwise overriding the UpdateAttack() method is useless because you can't access the _controller.

    I had to override UpdateAttack() to put in my xbox one controller inputs.

    Code (CSharp):
    1.  
    2. public class Ash_ThirdPersonInput : CoverShooter.ThirdPersonInput
    3. {
    4.     float deadZone = 0.1f;
    5.  
    6.     protected override void UpdateAttack()
    7.     {
    8.         _controller.ZoomInput = false;
    9.         _controller.FireInput = false;
    10.  
    11.         base.UpdateAttack();
    12.  
    13.         if (Input.GetAxis("Zoom") > deadZone) _controller.ZoomInput = true;
    14.  
    15.         if (Input.GetAxis("Fire") > deadZone) _controller.FireInput = true;
    16.     }
    17. }
    18.  
    The xbox one triggers are axis, not buttons.

    Same goes for _motor, currentWeapon, _inventory and making the InputWeapon() method protected. Otherwise overriding UpdateWeapons() doesn't do much.

    Could always use another getcomponent to grab the controller etc. but it's already there, so might as well use it :)
     
    Last edited: Oct 20, 2018
  32. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    There is a collider behind each enemy marked as trigger. I could use raycast but it would be performance killing so i used trigger.
     
  33. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Guys, we are offline till the 30th of October. Thanks for helping each other on a forum I get 50% fewer support emails!
    Cya
     
    Camelot63RU likes this.
  34. Reiner

    Reiner

    Joined:
    Dec 2, 2012
    Posts:
    214
    I have the assets you use in the Tuturial so i only need your project file to test it :):)
     
  35. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    Has anyone come up with a way to make it so when you shoot a barrel it does explosive damage?
    I tried making a NPC with a explosive prefab for the ondeath prefab, but it didn't work.
    Another part of this is, if that isnt the way to make this happen how do i give something health that our bullets can deal dmg to.
     
  36. umair21

    umair21

    Joined:
    Mar 4, 2016
    Posts:
    147
    In TPCS, Shooting is Prefab Shooting. Physical bullets are fired so, you can use scripts on objects to detect bullet hits. That's one approach I came up with. There are many others.
     
  37. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    Yep that was my backup plan certainly.
    What about explosions. Did you come up with a damage applicator for that?
    The prefab that gets generated for that isn't a physical prefab [unless I missed something?], so I'm not sure how to dish out the AoE pain with it.

    Nvm figured it out
    On death of Barrel just activate the Grenade Script with a timer of 0
     
  38. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    212
    ya, you are most welcome. I am already using control freak 2 so i thought i should remind you coz we are in the same boat. :D
     
    Rahd likes this.
  39. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    Dude my game has boats , horses , bikes , tanks ...
    and each one is it's own controller and scripts ...months now trying to make a universal controller for all .but with this cheap plugin it's all one in one day !!.
    thank you a million times again !! , you saved me literally from abandoning the game dev.
    I vouch for the control freak 2
     
    lolclol likes this.
  40. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    The barrel of my gun and my aim point don't line up AT ALL. Bullets shoot at the aim point but the nose of my pistol is pointing well below it. Whenever I move the pistol the aim point moves up and away from it also. I somehow have to get the crosshair in front of the barrel. How do you fix this?
     
    Last edited: Oct 20, 2018
  41. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    Post some screen shots dude.
     
    Paul-Swanson likes this.
  42. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    depending if third or first , go to the camera script and in start add
    it should be like this ,PS: i'm not on pc will correct the code later with correct spelling
    // controller = third or mobile i will use mobile example here .
    mobilecontroller CRTL= GetComponent<mobilecontroller>();
    player = CRTL.gameobject.GetComponent<charactermotor>();
     
  43. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    yeah man you gonna need to adjust the gun at run time and copy it's transform
    best way to do it , is to put the aim points(empty gameobject ) in an empty game object inside the gun and have the transform of all 0 ,0 ,0 on position and rotation
    then run the game and start shooting , adjust the gun first so the trigger hand is in place , then adjust the aim till the holding hand is on the gun grip , then adjust the aim points till the effect is coming from the muzzle . once all of that is done and the gun is perfect , save the gun as a prefab in runtime so you want lose the edit you just did .
    then stop the runtime and select the gun and click revert , or simply replace it with the prefab .
     
  44. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    Or you can even copy the transform. Then paste just the values.
     
    Rahd likes this.
  45. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Thanks guys. I started from scratch and noticed I had been adjusting my gun mesh and not the parent object. It got my gun all out of whack.
     
  46. Anhella

    Anhella

    Joined:
    Nov 18, 2013
    Posts:
    67
    good day
    T P C S is number #1
    can some one tell how to make the N P C/Enemy Character attack faster and more aggressive.
    The Video is to blurry for me.
    thanks in advance
     
  47. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    check the heroes stats in scripts , i think the sniper is the fastest one . just compare it to jack(melee) and you will find the values that makes him fast , you can find those in the main third person or strategy examples
    upload_2018-10-22_13-39-40.png
     
    Last edited: Oct 22, 2018
  48. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    Has anyone tried an integration with adventure creator ?
     
  49. Camelot63RU

    Camelot63RU

    Joined:
    Jul 20, 2014
    Posts:
    17
    Need some help guys, how fix this?
     
    Last edited: Oct 23, 2018
    Rahd likes this.
  50. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    There's been reports about this thread so I am here now. If people do not act mature I will remove them from the forum. Please focus on making your games and using the asset, while being polite to each other.

    Thanks.