Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Third person cover controller

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

  1. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    117
    Are you sure that your player has proper script for restarting the scene?
     
  2. io1

    io1

    Joined:
    May 7, 2015
    Posts:
    13
    Was this reply intended for Toby31 mukki014?
     
  3. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    117
    I think yes . Sorry for the mistake .
    Well hope he solved his problem.
     
    io1 likes this.
  4. redoxoder

    redoxoder

    Joined:
    May 11, 2013
    Posts:
    73
    thanks for the beta ,
    just tested, ai system is great!!! very good job

    is it possible to have tuto for custom action or a sample scene to understand it ;D
    (like open door, climb ladder)

    thanks for your great job .
     
  5. Sam77777

    Sam77777

    Joined:
    Jun 15, 2019
    Posts:
    5
    @EduardasFunka i sent you email with invoice yesterday, can you please send me new beta version.
     
  6. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    245
    please let me know
    do you plan having 1.7 to work on unity 2017. you said something about copying file manually to make it work, can you give costumer access to an archive for that file structure ? I know you can't have both on unity store, but i'm on 2017 and wish to update... I'm currently on 1.5 and will be upgrading to 1.6.2 (is it compatible with 2017?) 1.7 and new AI seems really badass, congradulation, I hope i can update
     
  7. raikoification

    raikoification

    Joined:
    Apr 13, 2019
    Posts:
    4
    Hi, just a few questions

    changing the reload animation in mechanim makes all the gun sounds for that type not play anymore (aside from shooting), how do i fix this?

    and how do I add hitboxes/different hitboxes (i.e head hitbox with multiplier)?

    Also not sure why, whenever someone dies (character or AI) they fall through the floor
     
    Last edited: Jun 16, 2019
  8. Anhella

    Anhella

    Joined:
    Nov 18, 2013
    Posts:
    50
    Good day
    I love third person cover shooter so far no problems:). but one very small thing, can anyone tell me how to fix the player to face the direction I place it in? when I face the player in the desire direction, in play mode it turns facing the opposite direction. please how to fix thanks in advance.
     
  9. timinal

    timinal

    Joined:
    Jul 19, 2012
    Posts:
    23
    Attach this script to the player character:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using CoverShooter;
    5.  
    6. public class SetStartRotation : MonoBehaviour
    7. {
    8.     void Awake ()
    9.     {
    10.         //Set the character's rotation to the rotation in the editor as opposed to the default rotation
    11.         gameObject.GetComponent<CharacterMotor>().SetBodyTarget(transform.position + transform.forward*1);
    12.         gameObject.GetComponent<CharacterMotor>().SetAimTarget(transform.position + transform.forward*1);
    13.  
    14.     }
    15.  
    16.     void Start ()
    17.     {
    18.         // Put the camera behind the character as opposed to the default position
    19.         GameObject.FindWithTag("MainCamera").GetComponent<ThirdPersonCamera>().Horizontal = transform.eulerAngles.y;
    20.     }
    21. }
    22.  
     
    Paul-Swanson and Rahd like this.
  10. Anhella

    Anhella

    Joined:
    Nov 18, 2013
    Posts:
    50
    Last edited: Jun 17, 2019
  11. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    43
    How do you setup dual wielding weapons? Have checked dual wielding in character inventory, moved position on LeftHand under gun in right hand but cannot then rotate hand into position to match the gun? Also no effects for second gun firing. Has anybody gone through the process on how to do this?
    Any Help would be greatly appreciated :)
     
  12. io1

    io1

    Joined:
    May 7, 2015
    Posts:
    13
    Hey Eduardas I've read through the reference manual you made for your new AI system and it's very nicely done. I thought i'd offer some feedback based on random things that popped into my mind as I was reading through it.

    When you present it it could be helpful to list some AAA or indie titles that your ai system can be used to emulate. This would help to give an easy to understand context in respect to its capabilities.

    Is this ai designer compatible with other 3rd party systems and if so how would that work?

    When developing your tutorials I wondered if you could consider elaborating on the thought process you use when thinking about designing ai for tpcs, for example could this be used to create formations? If so how might we approach that?

    How could i use this system create an attack drone?

    On the raycast section in the manual and on the first example there is some lorem ipsim text in place of the details of that particular function.

    For the end id thought id sneak in a quick wish list of stuff.

    Shoulder switch from right to left like division, spec ops the line ect (might have missed it)
    A slide animation, slide general and slide to cover
    A custom slot for single animations, perhaps in the inspector, for stuff like destiny 2 emotes or what ever.
    Death ragdolls
    Fook IK
    And ammo and health pickup system.

    I get you've got your own things but if you like any of these ideas id love to see them've

    IO
     
    EduardasFunka likes this.
  13. Sam77777

    Sam77777

    Joined:
    Jun 15, 2019
    Posts:
    5
    Hi @EduardasFunka,
    is there some tutorials how to use new AI system?
     
  14. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    43
    I think Ed has posted a draft of the manual for A.I system a few pages back. Don't think it's released yet. Let me know if I'm wrong though as would like to take a look at it myself :)
     
    io1 likes this.
  15. io1

    io1

    Joined:
    May 7, 2015
    Posts:
    13
    I think it's not realised yet though you may be able to get access to a beta version if you send him your invoice number.
     
  16. MastermindInteractive

    MastermindInteractive

    Joined:
    Jun 13, 2014
    Posts:
    87
    @EduardasFunka - Can you direct me to the code in the new beta that fixes the issue where the character doesn’t face forward. I tried Diffing it from my code and I’m not seeing anything that immediately stands out as a fix. I have customized your scripts and do not want to overwrite my own but I want that one bug fixed.

    Thank you.
     
  17. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    462
    Hey working on those.
     
    Lay84 and Pat19645 like this.
  18. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    32
    @EduardasFunka about a month and a half and still no answer. I am still unsure how to get the laser functioning on mobile top down. I have looked and the issue seems to be there is no laser component attached to the pistol prefab. The Base gun script looks like it will not run adjustLaser() method if there is no laser script attached to the gun. I tried to attach the Laser Script but it gave really wierd results, so i went backed and looked at your Topdown(PC) scene and there is a Laser Child Object on the pistol,I created a prefab of that Laser and added it to my pistol in my scene.

    The Basegun now effective calls adjust Laser, and registers hit colliders but still no visible Laser. During play mode i can see that the alpha on the Laser Script is forced to zero every frame, but no sure what to do to change that as there is a lot of things happening in the laser script concerning the alpha.

    Examples:

    Code (CSharp):
    1. //From BaseGun
    2.  
    3. private void adjustLaser()
    4.         {
    5.          
    6.             // Adjust the laser.
    7.             if (_laser != null)
    8.             {
    9.                
    10.                 var origin = Origin;
    11.                 var direction = Direction;
    12.  
    13.                 bool isFriend;
    14.                 var hit = Raycast(origin, direction, out isFriend, false);
    15.  
    16.                 if (hit.collider == null)
    17.                 {
    18.                     _laser.Setup(origin, origin + direction * Distance);
    19.                    
    20.                 }
    21.                  
    22.                 else
    23.                 {
    24.                     _laser.Setup(origin, hit.point);
    25.                    
    26.                 }
    27.                  
    28.             }
    29.         }
    Code (CSharp):
    1. //Update from Laser Script with Alpha calls.
    2.  
    3. private void Update()
    4.         {
    5.             if (Alpha < _laserIntensity)
    6.             {
    7.                 _laserIntensity -= Time.deltaTime * 8;
    8.                 _laserIntensity = Mathf.Clamp(_laserIntensity, Alpha, 1);
    9.             }
    10.             else
    11.             {
    12.                 _laserIntensity += Time.deltaTime * 3;
    13.                 _laserIntensity = Mathf.Clamp(_laserIntensity, 0, Alpha);
    14.             }
    15.  
    16.             if (_renderer.material != null)
    17.             {
    18.                 _renderer.enabled = Alpha > float.Epsilon;
    19.  
    20.                 if (_renderer.enabled)
    21.                 {
    22.                     var color = _renderer.material.color;
    23.                     color.a = _laserIntensity;
    24.                     _renderer.material.color = color;
    25.                 }
    26.             }
    27.             else
    28.                 _renderer.enabled = Alpha > 0.5f;
    29.  
    30.             if (_generatedLength == Length)
    31.                 return;
    32.  
    33.             _generatedLength = Length;
    34.             var length = transform.InverseTransformPoint(transform.position + transform.forward * Length).magnitude;
    35.  
    36.             const int detail = 32;
    37.             const int vertexCount = detail * 2;
    38.             const int indexCount = (detail - 1) * 6;
    39.  
    40.             var vertices = new Vector3[vertexCount];
    41.             var colors = new Color[vertexCount];
    42.             var uv = new Vector2[vertexCount];
    43.             var triangles = new int[indexCount];
    44.  
    45.             var v = Length / MaxLength;
    46.  
    47.             for (int i = 0; i < detail; i++)
    48.             {
    49.                 var p = i / (float)(detail - 1);
    50.                 var a = Mathf.PI * 2 * p;
    51.                 var u = Mathf.Cos(a) * 0.5f + 0.5f;
    52.                 var x = Mathf.Cos(a);
    53.                 var y = Mathf.Sin(a);
    54.                 var p1 = new Vector3(x, y, 0);
    55.                 var p2 = new Vector3(x, y, length);
    56.  
    57.                 vertices[i] = p1;
    58.                 vertices[i + detail] = p2;
    59.                 uv[i] = new Vector2(u, 0);
    60.                 uv[i + detail] = new Vector2(u, v);
    61.             }
    62.  
    63.             var index = 0;
    64.  
    65.             for (int i = 0; i < detail - 1; i++)
    66.             {
    67.                 triangles[index++] = i;
    68.                 triangles[index++] = i + 1;
    69.                 triangles[index++] = detail + i;
    70.  
    71.                 triangles[index++] = i + 1;
    72.                 triangles[index++] = detail + i + 1;
    73.                 triangles[index++] = detail + i;
    74.             }
    75.  
    76.             _mesh.Clear();
    77.  
    78.             _mesh.vertices = vertices;
    79.             _mesh.colors = colors;
    80.             _mesh.uv = uv;
    81.             _mesh.triangles = triangles;
    82.         }
    83.  
    ANY help would be appreciated as I need this to work so I can try and implement a critical hit system based on how long the laser is hitting the enemy........

    Thanks
     
    f1chris likes this.
  19. iamabdurrehman

    iamabdurrehman

    Joined:
    Aug 3, 2017
    Posts:
    2
    i have a problem . i spawn player at some point .. but is change the rotation ... whatever i put any rotation .. is spawn son same point
     
  20. iamabdurrehman

    iamabdurrehman

    Joined:
    Aug 3, 2017
    Posts:
    2
    i have a problem . i spawn player at some point .. but is change the rotation ... whatever i put any rotation .. it spawn on same point as previous spawning before changing rotation
     
  21. Anhella

    Anhella

    Joined:
    Nov 18, 2013
    Posts:
    50
    TPCS #1!!!!!!!!!!!!
    When will the new update come out?
    thanks in advance
     
  22. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    462
    when all promo stuff is done, tutorials and documentation. If you want beta send an invoice.
     
    redoxoder likes this.
  23. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    32
    @EduardasFunka Response to my question as well would be appreciated.
     
  24. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,403
    Is asset dead?
     
  25. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    289
    What makes you think the asset is dead?
    He's been giving Betas for the next release to ppl that ask, He also just finished writing a rather massive overhaul to the AI and now has to document a huge amount of changes.
     
    Rahd likes this.
  26. kwikman

    kwikman

    Joined:
    Jan 19, 2018
    Posts:
    3
    Hello

    I've just bought this asset. It looks to be a very solid pack indeed.

    I'm trying to follow the 18 part tutorial. I get the guns etc to work. But, when i try to walk in the BoD terrain (in 9. Setup Main Scene, using Unity 2018.2.8f) the character sometimes makes the terrain 'jitter' (character and camer stady but terrain jitters alittle) and sometimes the character 'slides' along the terrain and start to wave its arms. ( I know that it would be better with a image but the 'problems' cant be seen in a still image so..)

    Sorry if this question is already answered or me just being blind for the solution! Hopefully this has a simple solution.

    Br
    Kaj

    PS I have experienced the same behavior with for example the Post Apo environment from Manufactura K4
     
    Last edited: Jul 5, 2019
  27. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    32
    @EduardasFunka , once again, any answer on this would be appreciated........

    @Everyone else, I am trying to work through my own solution as it appears no answer will be giving but I ran into a issue. I'm curious if anyone else noticed this and/or have a solution.

    when crouching and aiming at enemy, the raycast hit from base gun returns back null for collider and transform, actually it registers the collider for a frame, then returns null every frame after even though you are still aiming at enemy. The bullet still strikes enemy and does damage but raycast hit still returns null. even FindCurrentAimedHealthTarget() returns null if you are crouching. My theory is it has something to do with the array set up on the ray cast method, it gathers all hits and returns the closest but from crouching the angle may cause issues....

    my script needs to get the fighter brain from ray cast hit in order to check if idle. so far the script works perfectly when standing and aiming, but will not work when crouching,

    Thanks
     
  28. kwikman

    kwikman

    Joined:
    Jan 19, 2018
    Posts:
    3
    Edit 1: 2019.7.9

    Hmm, in BoD it seems that the Terrain collider is par of the issue. I'm not sure why. But the character moves on all the other parts that have a collider.
     
    Last edited: Jul 9, 2019
  29. kwikman

    kwikman

    Joined:
    Jan 19, 2018
    Posts:
    3
    Edit 2: 2019.7.09 Later the same day that will say :)
    Started to read the code and saw that the Physics.RaycastNonAlloc used the Layer.Geometry value (which is same as Default). Then a check in (at least my) imported BoD _Environment/Terrain/Terrain_ForestSample:s Layer was unset! When changed to Default the problem was solved!

    Br
    Kaj
     
  30. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
    Hi EduardasFunka how to make the AI attack game object like a cube for example?? and how to make the AI receive damage on collision for example I want the AI dead when a big rock hit it??
     
  31. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    32
    Put a trigger on the rock, make a script on the rock that has on trigger enter, the other ref from on trigger will be the enemy gameobject. Do a get component for the Character health script and call deal damage.

    Hopefully that explains, I'm not home or I would type up the script to help you out but that's pretty simple.
     
    GWStudio likes this.
  32. yufik_selalu

    yufik_selalu

    Joined:
    Jul 6, 2019
    Posts:
    3
    Helo.
    I've just bought this asset and learn unity. now i stuck on picture.
    how to remove or disable black circle on this picture.
     

    Attached Files:

  33. satchell

    satchell

    Joined:
    Jul 2, 2014
    Posts:
    104
    From the Scene View select Gizmos drag the slider for 3D Icons to the left.
     
    yufik_selalu likes this.
  34. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    245
    i wrote here, never had any reply in the last 5 month, i wrote on both of @EduardasFunka email, no answer... where do i need to go or write to get support and answer ? it's annoying, i've been here since the beginning, had invest thousand of dollar at the beginning to make thing going and working but today im not even sure i can upgrade to latest version on store or upcoming version even less...

    what's the best way to communicate and can you send me the beta to the new asset so I can check compatbility
     
    Lay84 likes this.
  35. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    43
    click on gizmos in scene view and drag the slider should get rid of the circle
     
  36. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    334
    From what I understand, new version is ready but waiting for documentation to be completed ?
     
  37. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    323
    Hi @EduardasFunka , I hope you are doing well , any news about the update ?(not the beta ) ...
     
  38. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    462
    All good. Took some holiday break
     
    Rahd, redoxoder and Unplug like this.
  39. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    462
    Yes also convert scenes to 2017.4
     
    Rahd and redoxoder like this.
  40. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    462
    Sorry if i did not replay can you send me again?
     
  41. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    289
    Welcome back!
    Hope you got a nice rest!
     
  42. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,403
    Hello, when does the asset get updated?!? Where / How can I get the latest beta?
     
  43. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,403
    when will you add save/Load system?
     
  44. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
    Hi Lay84 ..
    I hope you are in Home to write the script that deal the damage :)
     
  45. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    32
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5.  
    6. namespace CoverShooter
    7. {
    8.  
    9.  
    10.     public class Boulder : MonoBehaviour
    11.     {
    12.        
    13.         //Damage amount to be applied after trigger
    14.         [SerializeField] private float damage;
    15.  
    16.  
    17.         private void OnTriggerEnter(Collider other)
    18.         {
    19.             //Get Character health component from AI then apply damage.
    20.             var _enemyHealth = other.GetComponent<CharacterHealth>();
    21.             _enemyHealth.Deal(damage);
    22.  
    23.         }
    24.        
    25.     }
    26. }
     
    GWStudio likes this.
  46. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
    Hi Lay84 ..
    Thank u for replying to My Question i have already did it by this script :

    using UnityEngine;
    namespace CoverShooter
    {
    public class GetCom : MonoBehaviour
    {
    public float Damage = 10;
    private Vector3 normal;
    public float DamageResponseWaitTime = 0;
    private HitType type;
    // Start is called before the first frame update
    void Start()
    {
    }
    // Update is called once per frame
    private void OnTriggerEnter(Collider other)
    {
    if (other.gameObject.GetComponent<CharacterHealth>() != null)
    {
    var hit = new Hit(other.ClosestPointOnBounds(transform.position), normal, Damage, Character.gameObject, other.gameObject, type, DamageResponseWaitTime);
    other.SendMessage("OnHit", hit, SendMessageOptions.DontRequireReceiver);
    }
    }
    }
    }
    i know its not good script because i have no programming knowledge but its working i will try your Script its better than mine ..
    Now i need your help with 1st Question ((how to make the AI attack game object ''NOT THE PLAYER'' Like a car or Helicopter or just a simple cube for example??)) I tried to add agent script but it require character Motor script and that what i don't want i hope to help with that ..
    thank u again for replying
     
  47. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    245
    Saving an dLoading are pretty much game specific... your request doesn't make much sens. What do you want to save, position, health only, level progress, time, score, etc... load/save module already exist on the store and unity offer pretty good tutorial on that too.
     
  48. Lay84

    Lay84

    Joined:
    Mar 8, 2014
    Posts:
    32
    I personally am unsure on how you would do that.
     
  49. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
    In previous versions 1.3 I think only Actor script needed to make AI attack any gameobject but in recent versions its not possible to do that .. May be we should ask @EduardasFunka ??!!
     
  50. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    323
    i think anything with CharacterHealth attached to it will be attacked.
     
    GWStudio likes this.
unityunity