Search Unity

Third person cover controller

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

  1. raikoification

    raikoification

    Joined:
    Apr 13, 2019
    Posts:
    4
    It did not fix the problem
     
    Last edited: Apr 17, 2019
  2. nearearthsports

    nearearthsports

    Joined:
    May 28, 2018
    Posts:
    4
    I got your asset for making some mobile games but I don't want to make mobile top down shooter. setting up camera is pretty difficult for top down, can you please explain how to do that.
     
  3. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    Look a few pages back in this forum and there is a video explaining it.
     
    redoxoder likes this.
  4. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    i used the third person input for some functions like jump , i dropped the whole thing and made the ones i need by hand .
    the cf2 tuto should cover everything and it will only works with third person
     
    redoxoder, Moe-Mogare and Lay84 like this.
  5. Moe-Mogare

    Moe-Mogare

    Joined:
    Apr 16, 2015
    Posts:
    19
    I was wondering can you please make a tutorial on how to use Horse animset with this engine it would truly help me out, I'm working on a 3rd person western shooter
     
  6. nearearthsports

    nearearthsports

    Joined:
    May 28, 2018
    Posts:
    4
    Such an amazing tutorial, I have one question, how to convert camera to third person for mobile instead of top down. I am banging my head to wall but unable to do this.
    I need auto aim functionality but with third person controller. How can I Achieve this please help.
     
    satchell likes this.
  7. nearearthsports

    nearearthsports

    Joined:
    May 28, 2018
    Posts:
    4
    Is there anyway we can implement third person camera for mobile not top down but with same aim assist functionality?
    if there is it'll be so awesome to get some help to make this feature work for me.
     
  8. raikoification

    raikoification

    Joined:
    Apr 13, 2019
    Posts:
    4
    anyone have a possible fix for this?
     
  9. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    It looks like you need setup gun for both hands left and right. If it does not help send me your model.
     
  10. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    i really can't those days due to health problems , however
    you just need to feed the x/y movements from the motor to the horse script it's really easy
    the hard part is the animation for riding the horse and the aim .
    you can get around that by coping the rider script code into the motor script and adding the animations of the horse pro animator (rider) as a new layer of the cover shooter animator .
    really sorry for the lack of help .
    good luck
     
    redoxoder, Moe-Mogare and satchell like this.
  11. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    hi there, i try to use (alert) script on door when it open i call (Activate) for it
    i set an enemy near to it, with 20 range for alert (enemy have listener with 1 value)

    anyway, when player open the door, the enemy don't change state (Idle) !!

    is that mean i make some mistake with alert script? how i implement my idea?
     
  12. satchell

    satchell

    Joined:
    Jul 2, 2014
    Posts:
    107
    Not 100% sure but try changing the tag to "Player" on the door GameObject.
     
  13. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    thanks for answer
    i change door tag to player
    but nothing is change!
    ok it not very important i will try with it later
    i face new strange problem

    i follow AI Spawn tutorial, (with different video is very old without inventory script!)
    anyway, the ai spawn not work! enemy don't call to spawn his friends... i sure i make like tutorial (with one different is inventory script that was not in tutorial!)
     
    satchell likes this.
  14. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    third comment about some bugs sorry about that :|

    anyway the problem is that the enemy don't see the player in some times, i mean it is a bug.
    - first i shot in my position (In the Upper floor) enemy listen that and see the player, then they try to come in upper floor.
    - in this time i go to in and Sit at the stairs that enemy will come from here, i set in other left side.
    - the problem is the enemy come ti the stairs and look on player position that they should not look there because there are a wall, they should look on up of stairs untill reach to up then look on player position.
    - from this problem, enemy don't see me while i set in the same stairs but in left side (they look on right side, so i behind them)

    enemy (e) come from down to up, and look the wall (police)

    upload_2019-4-25_17-56-32.png

    my old position (that enemy look on it know but there are a wall so should don't look on it) is blue color
    and the enem old position is black color
    upload_2019-4-25_17-58-41.png
     
  15. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
    hey Guys (and Gals), anyone have success implementing the roll function on the mobile controller (top down View). Roll method from the third person input/controller (TPC) works on input but it does not roll in the direction the player is facing. This is the code i experimented with, its only slightly modified from the TPC:

    MODIFIED in the Thirdpersoninput script*********

    protected virtual void UpdateRolling()
    {

    if (ControlFreak2.CF2Input.GetButtonDown("RollForward"))
    {
    var cover = _motor.GetClimbambleInDirection(aimAngle);
    if (cover != null)
    _controller.InputClimbOrVault(cover);
    else
    roll(Vector3.forward);
    }

    }

    private void roll(Vector3 local)
    {
    var direction = getMovementDirection(local);
    if (direction.sqrMagnitude > float.Epsilon)
    _controller.InputRoll(Util.HorizontalAngle(direction));
    }


    I removed the double taps of the WASD keys and tried to make only one roll in the facing direction. but its not working right. this is also under the Third person input script using control freak for touch input. I figured if I got it working properly I could implement it in the mobile controller but i think the logic is diff due to the camera.

    To be clear I am trying to create input function that will cause player to roll in the direction the movement joystick is facing on mobile controller. any help would be appreciated clearly I am not a programmer by trade so forgive if this is a simple solution, Thanks!
     
  16. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
    figured it out with a bit of reverse engineering. After seeing how the Roll funtion on the third person controller converted the moving direction into an angle, i was able to get it working on the mobile controller.
     
    satchell likes this.
  17. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    @EduardasFunka - I found an issue in the ThirdPersonInput.cs - When you are in cover and you rotate the camera to face the same direction as the cover object / move along the cover. right now it moves the character the opposite of the direction you want it to go. So if you press forward, it will go backward, and if you press back it will go forward. This makes it really difficult to enter and leave cover and control the character when you are doing anything other than looking at the character straight on.

    Here is the fix...

    Before...

    Code (CSharp):
    1.                 if (_motor.Cover.IsLeft(angle, 45))
    2.                     angle = Util.HorizontalAngle(_motor.Cover.Left);
    3.                 else if (_motor.Cover.IsRight(angle, 45))
    4.                     angle = Util.HorizontalAngle(_motor.Cover.Right);
    After...

    Code (CSharp):
    1.                 if (_motor.Cover.IsLeft(angle, 45))
    2.                     angle = Util.HorizontalAngle(_motor.Cover.Right);
    3.                 else if (_motor.Cover.IsRight(angle, 45))
    4.                     angle = Util.HorizontalAngle(_motor.Cover.Left);
    By swaping the _motor.Cover.Right and _motor.Cover.Left angles it makes it so that moving forward along a cover will make you move forward and moving backward will make you move back instead of the opposite. It also make it easier to leave cover.
     
    redoxoder and Lay84 like this.
  18. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    @EduardasFunka - is it possible to make the AI take turns firing at an enemy if they are in the same team? Right now all of the enemies fire at the same time which makes it a really unfair fight. Most AI in games make the enemies take turns if they are in the vicinity of a teammate. Think Of the Rocksteady Batman games.
     
    Rahd, redoxoder and Lay84 like this.
  19. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Current AI you can play with burst fire and give different parameters. Create different types "sniper" "rusher" etc. but that's it. With new AI you will have more options. You can scan how many teammates AI have and increase wait time before shooting, decrease accuracy. If you have some specific suggestion on how to do those "turns" that would be great.

    Preview of AI brain. There are lots of possibilities to customize behavior.
    upload_2019-4-29_9-14-20.png
     
    io1, Hamesh81, TeagansDad and 2 others like this.
  20. redoxoder

    redoxoder

    Joined:
    May 11, 2013
    Posts:
    74
    looks greet ...can't wait ..lol
    a release for ????….thanks
     
  21. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    I’m not sure how you are coding this in order to make suggestions, or even what type of AI techniques you are employing. My thought is that if the enemies are all engaged and have scanned that they are in the same fight with the same enemy they could randomly take turns shooting a burst. So give them an amount of time to wait to check if it is their turn, if no one is shooting and they don’t need to reload then shoot. Then reset that timer to wait. This will give other enemies time to shoot. This may require a manager outside of the enemies to keep track of who has shot and when or whose turn it is so that it ensures you don’t get shot at by more than a few enemies at the same time.


    Is there currently a way of knowing if the enemies are all in the same fight?
     
    Last edited: Apr 29, 2019
    redoxoder likes this.
  22. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    redoxoder likes this.
  23. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Curent version in the store I belive works up to 2019.2 beta.
    Now we have different problem New version only works on 2019.2 beta because how unity saves asset file where we store UI data... need to copy paste lots of stuff manually to make it work on 2017.
     
  24. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    @EduardasFunka - I want to add a delay every time the enemy sees the player initially. Right now when they see the player, they instantly jump into action. I want them to wait between a certain random amount of time to give the player a chance to get away without fully alerting them. If the enemy still sees them once that time is up, then they jump into action. If that is too difficult, I simply want to add a delay to the enemy's actions once they spot the player. How can I do this?
     
  25. jandernunes

    jandernunes

    Joined:
    Nov 18, 2013
    Posts:
    5
    No problems!
    I'm really looking forward to this update.
    I was looking to buy another AI asset, but I'm afraid of conflicts. I'll wait for your asset and buy it.
     
  26. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    @jnbbender @satchell -
    Hello, I'm having this same issue. My character is facing the wrong direction when I press play. Also, the camera starts at the feet for some reason and moves up. This code you provided isn't working. It seems to be happening before start.
     
  27. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    Is anyone interested in helping me clean up and make improvements to this asset, maybe even comment and document it? I know that the developer is working really hard on new features but there are a lot of things that need to be fixed and made more performant. We can use a private github that only we access or if the developer is willing to share theirs we can submit pull and commit requests... If you are interested please feel free to PM me.
     
    JBR-games and Lay84 like this.
  28. nik_bluebird

    nik_bluebird

    Joined:
    Mar 1, 2019
    Posts:
    2
    Hello guys,

    This asset looks great. It has most of core features for making third person shooter game.
    I had some questions/doubts regarding asset, so I emailed it to developer 3 days ago.

    But it looks like customer support isn't good. There is no ticket system also, which tracks everyone's request. I seen many questions/queries unanswered in this forum.
     
  29. Ralrigs

    Ralrigs

    Joined:
    Nov 17, 2014
    Posts:
    10
    Damn add multiplayer with assault gamemode and im in, im behind a kit TPS with multiplayer mode and this one have good AI in bonus but its missing the multiplayer
     
  30. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    Thanks but I Patreon him for 6 months to have access to latest Github but last few times i tried I didn’t have access to it. Just stopped Patreon !
     
  31. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    I wonder if he’s be willing to sell the rights to it flat out just like the folks sold UFPS to Opsive... or if he’s be willing to partner with one of us to run support and updates on the core asset while he works on the fun stuff...
     
  32. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Hi
    strange I can see your acc in our repo
    upload_2019-5-3_14-15-18.png
     
  33. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    we fixed bug when a character faces the wrong direction on start.
     
  34. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    If you want to help with the asset you are welcome, not sure about the legal side but we can chat about those things in private.
     
  35. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    I've made a lot of changes to the TPCS scripts. Would you mind sharing what those changes are so that I can fix it in my version?
     
  36. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Currently struggling through trying to link Inventory Pro with Playmaker and the Third person cover shooter template. have read through the forum and have seen people have managed to make it work with the template. Only want a basic inventory to store weapons, medkit and ammo. Have watched multiple tuts and have set up a medkit in inv Pro with TPCST Character in test scene following along with
    on play cannot select medkit to show in inventory. Have also watched this tut and tried this method with a weapon and weapon/cube doesn't show up in inventory. but just disappears on play

    @Paul-Swanson has linked me to this video for creating a bridge to reference playmaker and the TPCST but have not yet set this up.

    I'm totally new to Playmaker and inventory pro and was wondering if anybody has used any useful tutorials/ links or can make one to integrate Inventory Pro? @AshyB @Rahd @f1chris
    Will a bridge script need to be written to reference TPCST to Inventory Pro? What will this consist of? will it be a similar deal as the one that would need to be written for playmaker to TPCST?
    @EduardasFunka With the upcoming update is an inventory something you will be including or a bridge or due to be released in a near future update?

    Any advice would be greatly appreciated, thanks in advance :)
     
  37. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    89
    Script Update - Realistic(ish) Bullet Projectile Damage

    I noticed that when I shot at anything and it moved, the projectile would still register a hit on the target even though a lot of the time it was not at that position anymore. This resulted in the enemy being well beyond the original hit point and still registering as a hit; blood would instantiate in the open air. Further, if you tried to lead the shot and shoot in front of the moving target, it wouldn't work in the current implementation.

    Here is a change to the Projectile.cs script to 1) check if your original target is still at the area you originally shot once the projectile reached that spot and 2) checks if the bullet has collided with anything before it reaches it's destination. This does not use rigidbodies.



    Code (CSharp):
    1.  
    2.         // Added for realistic projectile damage
    3.         private Vector3 startPosition;
    4.         private Vector3 newTargetPosition;
    5.         private bool hitSomethingElse = false
    6.  
    7. private void OnEnable()
    8.         {
    9.             // Set the start position of this projectile
    10.             // so that we can use it as the starting point of the Linecast
    11.             startPosition = transform.position;
    12.             _path = 0;
    13.         }
    14.  
    15. private void FixedUpdate()
    16.         {
    17.             // Check every so often to see if we hit a player or enemy other than the
    18.             // original target
    19.             RaycastHit rc;
    20.             if(Physics.Linecast(startPosition, transform.position, out rc))
    21.             {
    22. if (rc.collider.gameObject.tag != Hit.Attacker.gameObject.tag)
    23.                 {
    24.                     // Update the Target information with the new target
    25.                     Target = rc.collider.gameObject;
    26.                     Hit.Target = Target;
    27.                     Hit.Position = rc.point;
    28.                     Hit.Normal = -rc.normal;
    29.                     newTargetPosition = Hit.Position;
    30.                     hitSomethingElse = true;
    31.                     Target.SendMessage("OnHit", Hit, SendMessageOptions.DontRequireReceiver);
    32.                     GameObject.Destroy(gameObject);
    33.                 }
    34.             }
    35.         }
    36.  
    37. private void Update()
    38.         {
    39.             transform.position += Direction * Speed * Time.deltaTime;
    40.             _path += Speed * Time.deltaTime;
    41.  
    42.             // Don't continue to run this if it is determined that
    43.             // another object intersected the trajectory path
    44.             if (!hitSomethingElse)
    45.             {
    46.                 if (_path >= Distance)
    47.                 {
    48.                     if (Target != null)
    49.                     {
    50.                         // Check the hit position to update the Hit information in case the target has moved.
    51.                         Collider[] hitColliders = Physics.OverlapSphere(Hit.Position, 0.25f);
    52.                         Vector3 dir = Hit.Position - Hit.Attacker.transform.position;
    53.  
    54.  
    55.                         for (int i = 0; i < hitColliders.Length; i++)
    56.                         {
    57.                             // Apply force at the position.
    58.                             Rigidbody r = hitColliders[i].GetComponent<Rigidbody>();
    59.                             if (r != null)
    60.                             {
    61.                                 r.AddForceAtPosition(dir.normalized * 1000, Hit.Position);
    62.                             }
    63.  
    64.                             // Determine if the tag of the collider is the same as the original
    65.                             // This requires that you add a tag to your gameobjects
    66.                             if (hitColliders[i].tag == Hit.Target.tag)
    67.                             {
    68.                                 Target.SendMessage("OnHit", Hit, SendMessageOptions.DontRequireReceiver);
    69.                                 break;
    70.                             }
    71.                         }
    72.  
    73.                     }
    74.  
    75.                     GameObject.Destroy(gameObject);
    76.                 }
    77.             }
    78.         }
    This could probably use some improvements. For instance, I could probably use another Linecast instead of an OverlapSphere at the end of the projectile's path to see if it still hit the original intended target.

    This is a little more performant than running it in the Update function but it could probably be improved.

    If you have updates, fixes or changes, don't hesitate to share.
     
    Last edited: May 5, 2019
  38. Moe-Mogare

    Moe-Mogare

    Joined:
    Apr 16, 2015
    Posts:
    19
    Thank you & what I meant by a Tutorial is if possible just some screen shots of the steps, & I really hope you get better my friend, hopefully this might help Boil some water with cinnamon, & grind up some ginger & toss it in there & drink it with honey
     
  39. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Update.
    Now AI can tell commands to other AI so you can make turns. wait before attacking etc. Coding will be done on Wednesday. Only documentation and promo material left.
     
  40. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
    Hey guys, I just noticed that I do not have the red laser aiming line working (top down mobile).... i also noticed on @satchell tutorial he doesnt either, is this something that was taken out or is there a box that I need to check to turn this on.

    @EduardasFunka Excited for the news!
     
    Last edited: May 6, 2019
  41. gsmax

    gsmax

    Joined:
    Jun 12, 2018
    Posts:
    15
    Hi guys, when my AI calls a spawner, it sometimes spawns an AI that just dies immediately it appears. Please what could be causing this.
     
  42. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Maybe you spawn dead AI from the scene? try span from the project folder, not from the scene.
     
    gsmax likes this.
  43. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    Hi, How i can move the character (civilian or enemy) using external script? I try this code but the character not move
    Code (CSharp):
    1. GetComponent<CoverShooter.AIMovement>().ToWalkTo(destination);
     
  44. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
  45. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    you a
    you activate it now with Right mouse click
     
  46. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
    for Mobile?
     
  47. gsmax

    gsmax

    Joined:
    Jun 12, 2018
    Posts:
    15
    Hi everyone, I created icons to mark my AI's on a minimap. Each AI has two icons, one for when alive and the other when dead. Can anyone please help me with a script to set activate (true or false) depending on if the AI is alive or dead.
    Am having troubles referencing the Characterhealth script .
    Thanks.
     
  48. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    @EduardasFunka Have updated project to latest build of TPCST, using 2019.1.0f2 and on runtime of demo scene in new project cannot play due to Library/PackageCache/com.unity.package-manager-ui@2.0.3. have deleted package cache folder and can play demo scene but upon reload of unity and project the package cache folder returns and have same issue. Is there another folder I need to delete in the project or should I be downloading the TPCST asset from the old store?
    Everything else seems to be working but A.I is still not using tall cover.
     
  49. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34
    @Toby31 I had this same issue, but I believe it was Unity package cache issue not TPCS. I tried many things but I think ultimately what fixed it was to go back to original editor version (hopefully you have a back up), go to Help>reset Packages, then upgrade project.

    Edit*
    Other options:
    try opening project from external harddrive to test issue.
    It could be also be conflicting unity temp cache stored in appdata so delete all unity 2018 appdata in C>user>appdata>unity folder.

    Hope this helps.
     
    JBR-games likes this.
  50. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    34