Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[RELEASED] Cover + Shooting System - Third Person Shooter

Discussion in 'Assets and Asset Store' started by Viniterra, Oct 6, 2017.

  1. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi fellows, my name is Vinicius, the creator of the 3rd Person Controller + Fly Mode asset.

    Today I am pleased to announce the release of the Cover + Shooting System - Third Person Shooter, a starter kit for any third person shooter game.

    Get it on the Unity Asset Store: Cover + Shooting System - Third Person Shooter

    cover+shoot-forum-head.png

    Besides the elements already present on the free asset, like run, sprint, jump, and aim behaviours, and a dynamic third person camera with collision detection, this asset contains scripts for player covering and shooting behaviours, as well as another special player movements.

    The cover system features auto navigation to cover, peeking around corners, turning over cover corners, quick transitions to nearby covers, and jump over cover movements.

    The shooting behaviour features full interaction with weapons, like pick up, aiming, shooting, reload, drop, and change weapon actions. This system presents configurable short and long weapons, like pistols, assault rifles, etc. Features 3 different weapon modes: semi automatic, burst mode and automatic. Effects for shot, flash, tracer, and bullet holes are included.

    This package already comes with Xbox One Controller input fully configured.

    On the asset page you will find a video presentation, based on the demo scene included, and a video tutorial explaining how to setup this asset on your own project.

    For any support related issues, to ensure the faster response, please use the official support channel:

    Support for the Cover + Shooting System

    This is the official forum for suggestions, comments, etc. Please fell free to provide any feedback.

    Thanks!
     
    Last edited: Sep 2, 2023
  2. FelipeCostaGualberto

    FelipeCostaGualberto

    Joined:
    Oct 7, 2017
    Posts:
    1
    This is great! I'm definitely buying it. The 3rd Person Controller you wrote is the best free asset in the store.

    Do you plan releasing more assets in the future besides these two?
     
  3. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi Felipe, Thanks for your feedback.

    As some people requested, there is a mobile version of the Third Person Controller + Fly mode on the way. This includes virtual buttons and analogs to simulate a gamepad controller on mobile touch devices.

    Also there are some other behaviours for the player to be published, but right now they are on early stage of development. You can keep on eye on my youtube channel, since it is the first place to know what I'm working with:

    https://www.youtube.com/@vmarques
     
    Last edited: Sep 2, 2023
    FelipeCostaGualberto likes this.
  4. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Here are some more details about the Cover behaviour. It features the following special movements:

    turn.gif
    The turn cover corners movement.

    change.gif
    The quick change cover action, for nearby covers.

    nav.gif
    Auto navigation to covers, within a specific range and in the player's FOV.

    stand.gif
    Dynamic cover height detection, for auto stand and crouch actions.

    jump_over.gif
    Quick jump over cover action, that returns to basic locomotion state.
     
    Last edited: Oct 16, 2017
    TokyoWarfareProject likes this.
  5. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Here are some more details about the Shoot behaviour. It has the following features:

    shot.gif
    Particles for shot flash, shot tracer and the smoke trail.

    hole_smoke.gif
    Bullet holes, sparks and smoke on shot destination.

    change_weapon.gif
    Simple inventory system with 2 slots, for a short and a long weapon.

    pick_weapon.gif
    Weapon interaction, featuring pick up and drop, with weapon HUD and physics included.

    reload_weapon.gif
    Reload, shoot, hold and other interactions for short and long weapon types.
     
    Last edited: Oct 16, 2017
  6. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Other features:

    aim_cover_c.gif
    Aim over lower covers, without exiting the cover state, and switch shoulders when aiming.

    aim_peek_blocked_c.gif
    Peeking and aiming on wall corners when covering, and block aim when too close to a target.

    lock_on.gif
    Camera lock on target, to follow player rotation on temporary movements.

    weapon_hud.gif
    And also a screen HUD to display the current weapon, bullet amount, and total bullets.
     
    Last edited: Oct 16, 2017
  7. arie1994

    arie1994

    Joined:
    Jun 30, 2016
    Posts:
    86
    when i use a long weapon in the demo and aim around corner the weapon starts acting wierd
    like it moves down then up of something
     
  8. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi, sorry for the delay.

    For support issues, I recommend the use of the support e-mail for a faster feedback.

    Could you provide more details of what is happening? If possible, a video or image of the issue.

    Thanks.
     
  9. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    Hi , Love the animations. Were these mixamo or did you make new animations ? Looks really cool
     
  10. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Mixamo is great, they provide amazing animations indeed, and their auto rig tool is also a time saving!

    Some of the animations are from the raw motion capture library from Carnegie-Mellon University, and some are customized also
     
    evilangel89 likes this.
  11. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi fellows. The latest version now deals correctly with slanted surfaces. While covering, you can walk up and down trough ramps, etc:

    ramp.gif

    The updated version is already available at the Asset Store.
     
  12. Mythran

    Mythran

    Joined:
    Feb 26, 2013
    Posts:
    85
    concurrency to invector at less than 1/2 of the price? Nice!
     
    Viniterra likes this.
  13. rjakob13

    rjakob13

    Joined:
    Apr 13, 2016
    Posts:
    45
    I have an issue with your other asset 3rd Person Controller + Fly Mode but your help might be interesting for others as well.
    As you can see in the attached screenshot the character is floating above the ground though the capsule collider is set up correctly. This screenshot was made using the example scene included in the asset as it is. The offset between the feet and the ground is very noticeable due to the shadows.
    It looks like the blue gizmo sphere is aligned to the ground collider but was is that?
     

    Attached Files:

  14. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi rjakob13, for questions related to this asset, I kindly ask you to use the comments section of the video tutorial related to this asset. There will be easy for anyone who is using it to see.

    As for the example you provided, these colored orbs are related to bone/joint positions of the skeleton/armature. I will try to open the avatar on a 3D editor where we can see the skeleton and check if it is correctly positioned.
     
    Last edited: Jun 6, 2018
  15. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    Is there any instructions to integrate with Emerald AI, or any other kind of AI system?
     
  16. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi, sorry for the delay.

    If you are want to use this package to control the player and camera, and the Emeral AI to control de NPCs on the scene, is perfectly possible, due to the great modular aspect of the Unity classes and objects. One does not interfere with the other.

    But if you are intending to use the behaviours defined here as custom actions for NPCs, unfortunately, due to the way this package was built, this is not possible at the moment. This package was crafted to deal with player and camera movements, controlled by player inputs that is handled inside the scripts. Although it can be done, you would need to adapt the scripts a bit.

    The good news is that an AI adaptation for this behaviours, to be used on NPCs, is on the plans to be crafted, and also an integration with multiplayer modes.
     
  17. dl290485

    dl290485

    Joined:
    Feb 4, 2018
    Posts:
    160
    Thanks for your reply.

    Actually I did not at all consider Emerald AI would take cover and etc. But I am interested in using this for player mechanics.

    What I would need though is some kind of tutorial which provides detailed instruction on how to let the AI send damage to the player (tailored specifically for how Emerald works with ranged and/or melee attack) and how the player would send damage to the AI. Ideally this could also include instructions on how this could be done with Play Maker, as I myself actually can't program a single line of code.

    I think you are saying that you (or an associate) are working on your own AI. That would also be great, as an all in one package would save the need to know how to integrate third party assets.

    Anyway, I love how your asset looks. Watching the video makes me want to make a Deus Ex like game :)
     
  18. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193

    To deal with player damage caused by enemies, you can use Play Maker normally, since the scripts for player behaviour are independent from anything you add to the player via Play Maker. You just have to deal with player health and player death on the Play Maker itself.

    The opposite situation is a bit different, since it will be the Shoot Behaviour script that will send the damage information to the NPCs. Right now it can be done by script. If you check the video tutorial (
    ), you will learn that you just need to add a class that inherits the Health Manager, and implement the TakeDamage() function inside it. This is the way to make the shoots interact with any object on the scene you want.

    Although I had no contact at all with Play Maker yet, I know it is a tool many people like to use. I'll look forward into it to see the best way to integrate with the asset, thanks for the suggestion.
     
    Shodan0101 likes this.
  19. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    488
    How can I fix the animations? When you look at the pistol aiming animation the hands get crossed. Maybe not for the shadow character but for all others. Also if you notice, when shadow character returns the pistol back to the withdraw position even his hands cross.
     
  20. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    488
    Hey @Viniterra you asked me to provide an image showing you the clipping I was experiencing. It happens when the player is covering against the wall. When he is not in cover the camera does a good job of not getting pinned. Here's a picture of the player covering against the wall.
     

    Attached Files:

  21. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    There was an update to address that, sorry for not including it on the video tutorial, as it was made before.

    But you can find an explanation on how to proceed on the README file, page 6 (Item 2 of the debug notes):

    Due to some variations in the armature (skeleton) structure of different player avatars,
    inconsistencies in some bone orientation may occur. This can cause anomalies such as a
    hand inside another. Although this is unusual, it can appear in some animations for your
    custom avatar. To address this, the last two parameters, which are under the Advanced
    Rotation Adjustments section, can be used to adjust the bone rotation for some cases in
    particular.
    The figures below show examples for the two situations. First, unadjusted and adjusted left
    (support) arm rotations, given by the Left Arm Short Aim parameter, resulting in a correct
    support hand orientation when aiming:


    upload_2018-5-17_17-16-16.png

    Second, unadjusted and an adjusted right hand rotations, given by the Right Hand Cover
    parameter, resulting in a correct weapon placement over the support hand:

    upload_2018-5-17_17-16-50.png


    These section refers to the Shoot Behaviour script, you can find these parameters at the bottom of it, via inspector:

    upload_2018-5-17_17-18-51.png
     
  22. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Thanks for pointing that. I'll use this situation to try to optimize the camera collision detection.
     
  23. Aruvyel

    Aruvyel

    Joined:
    May 26, 2015
    Posts:
    2
    Hello Viniterra and thank you for this amazing asset. I have sent you an email with an issue i have. I tryied to use two different player's body mesh but when i pick a weapon and aim, my character is twitching from the hips part.

    I do not have this issue when i use a Camera without the Orbit camera script and not attached to the scripts (as a single camera).

    You can see the issue on the picture attached to this post.

    Best regards and thanks again for this amazing asset ! I hope to have some advice to fix my issue as soon as you can help me.
     

    Attached Files:

  24. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    488
    This is an IK issue with the model and the package. I know with ootii you can choose to use IK or FK. I had the exact same effect when I used my model with ootii but when I disable IK in their scripts, my model snapped right back in place.
     
  25. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi Aruvyel,

    Thanks for the support on acquiring this asset. First I'll ask you to take a look at the skeleton of your character avatar and check for the issue described as follows.

    The following picture presents the skeleton/armature of an avatar that has the same issue you mentioned:

    1.png

    If you take a closer look on his chest, you will notice that, although it is a humanoid rig, this model skeleton structure does not contains any spine bones.

    Now please take a look at the next image, showing the skeleton of the default asset character (char shadow):

    2.png

    Again, taking a closer look at the chest, you can notice the presence of 2 bones that handles the spine movement. On a complete humanoid skeleton rig, they are used to separate the upper chest from the belly. Basically, they give a model the spine movement.

    The scripts on this asset, specially when shooting, needs at least 2 spine bones on the armature/skeleton to work properly. These bones are the responsible for the horizontal and vertical rotation response when aiming, provided by the Unity MonoBehaviour's IK pass. Without it, the response will not be realistic and may cause the issues like that you had identified, or even may not rotate the player at all.

    If you confirm that the model you are using lacks these bones, you can try to address the problem by using a great auto-rigging tool provided by Mixamo:

    www.mixamo.com
    https://helpx.adobe.com/creative-cloud/help/mixamo-rigging-animation.html

    This will sure work properly and rotate the player avatar according to the expected when aiming. Please let me know if it helps.
     
  26. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi jnbbender,

    I don't know what ootii means, but disabling the IK pass on the scripts may cause the them to not work properly. These sections are required as a post animation step to properly re-orientate the player spine, according to the aim direction defined by input (mouse or game controller).

    Please take a look at the response above on how to address this issue. Thanks.
     
  27. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    488
    @Viniterra Hey there, I seem to be having the same issue that @Aruvyel was having and was hoping you might be able to help me out. I'm fairly certain my avatar is rigged properly and have used it with many other animation packages. I've attached 2 images that would hopefully help - one with the debugging lines and the other is a snapshot of my rig. I've also successfully pulled down animations from mixamo using this rigged character as you had also suggested in that previous post. Thanks

    BTW - Within the Unity animator preview window everything looks fine.
     

    Attached Files:

    Last edited: Jun 6, 2018
  28. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi, I'll take a look into it. Could you please e-mail me on the support e-mail? It's in the README file. Thanks.
     
  29. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    First I wanna thank you for reporting this. I am replicating the answer I sent you by e-mail for future references by anyone with the same issue.

    The first observation you have already addressed, according to the print you have sent me. The model you provided was missing the chest bone configuration on the avatar definition. This bone is needed to set the vertical upper body rotation when aiming with a weapon. As you noticed, you just needed to select it and drag to the Chest position, under the Avatar configuration:

    upload_2018-6-6_3-34-20.png


    The real problem here was with the bones orientation. This asset uses the OnAnimatorIK pass to re-orientate the skeleton bones, based on input, and to correct animation errors due to different avatar configurations, based on the setup parameters of the scripts.

    The scripts was dealing with different initial rotation for both the spine and the hips bones. This model you provided in particular has a initial rotation on the root bone (0, -90, -90), something I had never seen before. Anyway, now the scripts deal with initial rotation from the root bone to the chest, in a cascade manner.

    I will send the updated version to the store. Hope it helps.

    Also, if it is not much to ask, I would be glad if you (and anyone who bought this asset) could review the Cover + Shooting System - Third Person Shooter asset on the Unity Asset Store. On this earlier stage of the asset, any feedback may encourage people who are in doubt about acquiring it, and will sure provide a great support to keep building another assets.
     
  30. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    The issue here that is strange indeed is not related to the asset itself, but to the default Unity camera clipping pane. Select the Main Camera and change the Near parameter under Clipping Panes from 0.3 to 0 (it will automatically change to 0.01):

    pan.png

    To improve it more, you can make the character a bit transparent when the camera is not in the default position, as some games do.
     
  31. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    488
    For anyone who's interested, I was having issues trying to make a ragdoll. The controller kept aiming then putting the gun back into a holding position. Just add the following to the ShootBehaviour.cs script in the CheckForBlockedAim() method.
    Change the second 'isAimBlocked' line to the following, or something similar:

    Code (CSharp):
    1. isAimBlocked = isAimBlocked && (hit.collider.transform != this.transform || !hit.collider.transform.IsChildOf(this.transform));
     
    Last edited: Jun 14, 2018
    Viniterra likes this.
  32. guillermofernandezcadarso

    guillermofernandezcadarso

    Joined:
    Apr 13, 2018
    Posts:
    5
    Did you tested this asset in network mode¿?
     
  33. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi Guillermo,

    Thanks for your interest. I currently have under development the basic (free version) of the asset, working with network support, using UNET.

    I pretend to extend it with the custom behaviours (cover + shooting) and launch a network capable version in a near future.
     
  34. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    488
    @Viniterra I just pulled in the latest release and I'm seeing some unusual behavior. When the player picks up a weapon the crosshair is drawn right away instead just of when aiming. I have a done a code diff with the previous release and can't seem to find anything that would cause this. Has anyone else experienced this?
     

    Attached Files:

  35. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    488
    @Viniterra Not really sure how this worked before but I ended up changing the AimBehaviour.cs script in the OnGUI() call to check for aiming,
    Code (CSharp):
    1. if (crosshair && aim)
    instead of just
    Code (CSharp):
    1. if (crosshair)
     
  36. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    I suppose you have altered the camera pivot for the default and/or aim position. The default camera position sets the pivot magnitude to a value of about 0.5. When aiming, this pivot magnitude is set to almost 0.

    The original idea of the script is to draw the crosshair only when the pivot magnitude is near to zero (mag < 0.05f). This way the crosshair is just shown when the camera is almost at the final aim position, ignoring the transition.

    The modification you have set by using if (crosshair && aim) is a good workaround, since it only verifies the pivot magnitude condition when aiming. In this case, you can even remove the magnitude conditional verification, if you want.
     
  37. VirtueRL

    VirtueRL

    Joined:
    Dec 23, 2017
    Posts:
    12
    Could you please implement hip fire? As I am planning on purchasing this wonderful asset, I am planning to make a multiplayer battle royale game and I have everything setup it's just I need this asset to include hipfire so the player doesn't have to aim in everytime he wants to shoot. I am only saying this because in the demo on the asset page it doesn't include hip fire.

    Sincerely,
    VIrtueRL.
     
  38. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi VirtueRL,

    Thanks for your interest in this asset. I suppose you want to use it for mobile platforms, since hip fire is the most efficient way for this kind of platform, in terms of usability.

    Since this asset is separated by behaviours, you can adapt it to what you desire in some steps:

    First, set the aim behaviour as a default mode.

    Then, do a quick script change, setting the the aim mode activation as always active instead of toggle it via aim button.

    After that you will have to change de camera position for the aim mode using the default values (the same values on the camera script).

    You may also want to change the animations for the strafe layer, that is the ones used when aiming, for some other you prefer, like running walking etc.

    Other optimizations may include set the animation state to the guard position when not shooting, instead of when not aiming.

    This steps should start guiding you to achieve what you want. Hope it helps.
     
    Last edited: Jul 15, 2018
  39. TechSins

    TechSins

    Joined:
    Feb 16, 2015
    Posts:
    142
    Will you be adding shooting a.i?
     
  40. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi, there is a plan for that indeed. I'll let you know about any updates. Thanks for the interest.
     
  41. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @Viniterra I just discovered this asset and it looks really nice. I'm curious about the roadmap of planned features. Will you be adding any features such as short climb, free climbing, or grenades?
     
  42. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi @magique, thanks for your interest. The first item on the roadmap is to create a multiplayer package. This project was already started, but it is in a hiatus right now, due to the next drastic changes Unity will made in UNET for upcoming versions. An enemy A.I is also no the roadmap.

    But there is plans to add 2 extension modes indeed, one contemplating 2 new types of long weapons (shotguns and sniper rifles), and other with explosive weapons, like rocket launchers, grenade launchers, and hand grenades.

    I have also put into consideration a simple melee combat system, based on bare hands, but easily adaptable for weapons.

    Thanks for the suggestion for a climbing mode, it is really an interesting extension.
     
    Last edited: Sep 27, 2018
  43. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @Viniterra OK, thanks for the information. I'll keep an eye on the development.
     
    Viniterra likes this.
  44. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    488
    @Viniterra Any other plans to implement the holster animations?
     
  45. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    It is not a difficult feature to add. But unfortunatley, I don't have any animations (custom or free ones) that I can use to add this to the package. :(
     
  46. RED_THEORY

    RED_THEORY

    Joined:
    Jan 18, 2019
    Posts:
    2
    Hi Viniterra. I'm trying to implement your cover system but having problems using scripts. When adding 'Basic Behavior' script, I'm getting this error. Also for some other scripts. Any ideas? (I'm using Unity 2018.3.4f1)
     

    Attached Files:

  47. RED_THEORY

    RED_THEORY

    Joined:
    Jan 18, 2019
    Posts:
    2
    Never mind. Seems to be working now. Don't know what happened. Tried a few times even on different pc's and wouldn't work. Then tried again the next day and it worked. Confused much!
     
  48. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi,

    Glad to know it is OK now. This seems to be an IDE error, the script mentioned is not even in the asset.

    By the way, for a faster response with support issues, you may use the support e-mail. There is a link for it on the readme file.
     
  49. Snigros

    Snigros

    Joined:
    Jun 12, 2018
    Posts:
    38
    Hi,

    Firstly wanted to say thanks for this system (and the free one) - both work well and I have also learnt quite a lot from looking at your underlying code. I did have one question however..do you have any plans to produce a version that leverages Cinemachine?

    P.S. I have had no problem doing simple things such as using a state driven vcam (in place of the code to change the FOV when sprinting etc) for example - but would like to do something similar when aiming/shooting (with a transition from a Cinemachine Freelook vcam). I have been struggling to get this to work properly with the player rotation code etc. however....
     
  50. Viniterra

    Viniterra

    Joined:
    Dec 4, 2014
    Posts:
    193
    Hi, thanks for the feedback. I have never been in touch with Cinemachine before. I'll download the package to acknowledge it.

    Are you trying to use the Cinemachine to control little in game changes and replace the scripted ones, keeping player controls, or to produce instant in game cut scenes, using a seamless like camera effect?

    If what you desire is the first option, you will have a bit of work to do. By design, as it is a classic third person perspective control, the movement scripts are camera dependent, as they always move the player in the direction the camera is facing. You may have to use alternate scripts to control the player on that specific situations.

    Otherwise, if it is the latter, I would recommend that you do this in a separated camera, where you can unhide it when a cut scene is triggered, and hide the main one, together with the player controlled scripts, animator etc.