Search Unity

Third person cover controller

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

  1. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    Hi
    i have activated the Walk / Run on the player by forcing the _animator.SetFloat ("MovementZ", 1); in run
    and _animator.SetFloat ("MovementZ", _localMovement.z - 0.5f); for walk
    (and -1 or -5 if it's negative) ... same goes for "MovementX"

    please do make an option to run or walk on the Main player like in the AI
    or How do i make IsSprinting true , or send the Walkspeed to the CharacterMotor on Mobile

    the _currentMovement.Magnitude = walkspeed; Do nothing i tried :( please help


    the problem now is my player keeps jerking around with postions when i move the aim or move stick on the 45 angle . so my fix is for now change some turn animation settings to root XZ into bake , and on the Mobilecontroller script i added this to update to lock the player
    Code (CSharp):
    1.   if (hasAiming) {
    2.                 Movement.x = 0;
    3.                 Movement.y = 0;
    4.      
    5.                 Rigidbody    m_Rigidbody =    this.gameObject.GetComponent<Rigidbody> ();
    6.                 m_Rigidbody.constraints =RigidbodyConstraints.FreezePositionY |RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionX |RigidbodyConstraints.FreezeRotationZ |RigidbodyConstraints.FreezeRotationY|RigidbodyConstraints.FreezeRotationX;
    7.          
    8.             }
    9.             if (hasMovement) {
    10.                 Rigidbody    m_Rigidbody =    this.gameObject.GetComponent<Rigidbody> ();
    11.                 m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationX;
    12.  
    13.             } else {
    14.                 Movement.x = 0;
    15.                 Movement.y = 0;
    16.                 Rigidbody    m_Rigidbody =    this.gameObject.GetComponent<Rigidbody> ();
    17.                 m_Rigidbody.constraints =RigidbodyConstraints.FreezePositionY |RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionX |RigidbodyConstraints.FreezeRotationZ |RigidbodyConstraints.FreezeRotationY|RigidbodyConstraints.FreezeRotationX;
    18.  
    19.  
    20.             }

    Please do add it because the player can go thru walls... and if the frames drop the player do go thru walls too ignoring collision. Please help
    love the asset 5/5 all day , thank you
    and please note you can make the mobile asset better if you buy the Third person cover system and replace the scripts with the new ones .
     
    Last edited: Dec 3, 2017
  2. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    Edit fixed By changing movement = _currentMovement.Magnitude * overallIntensity ;
    To
    movement = local * walkspeed;

    so if any one wants to make a Run walk button for mobile :
    add this to CharMotor
    Code (CSharp):
    1.     public bool isrunning = false ;
    2.         public float  walkspeed =0.5f;
    3.         public void run ()
    4.  
    5.         { isrunning = !isrunning;
    6.             if (isrunning){
    7.                 walkspeed = 1f;
    8.             }
    9.             else{
    10.                 walkspeed = 0.5f;
    11.  
    12.             }
    13.  
    14.  
    15.         }
    and have the button call run()

    again thanks for the asset you had everything working from the start , i just had to dig around . sorry to bother :) cheers.
     
    Last edited: Dec 3, 2017
  3. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Thank you for the suggestion. Yes, we will improve this aspect. We have improved the input system for an upcoming version and you'll have a much easier way of accessing that functionality. Stay tuned.
     
    Rahd likes this.
  4. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    You'll have to wait a few days for an upcoming version. We have added a Speed property to the CharacterMotor which will solve the exact issue you're having.
     
    f1chris, angel_m and Rahd like this.
  5. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I have configured my player with my own character model and I have adjusted the overall parameters to fit my model and needs. I have not touched the code, so I hope the new update will not break my configuration. ;)
     
    Last edited: Dec 4, 2017
  6. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    oh cool, so it's more than an AI update. Is it possible you can list the new features to be added and area with major rework ? it's giving us an idea of what is coming in so we can avoid working on that stuff and concentrate our efforts in another areas of our game.
     
  7. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    From what i understand the plugin will have a split version AI plugin easy to use with your own player controller or other plugins. It would be like the actual plugin but without the player controller , very usefull for existing projects or people using their own player controller system.
    The other improvments should be the AI behaviour itself, with some code rewrite, making it more modular, less hard coded so better to add features on top of it.
     
    Rahd likes this.
  8. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    HI , you can change the speed 3 ways
    First one : walkSpeed if it's 0.5 he walks 1 run , i think a value like 0.7 makes him slower
    you can find it here
    _motor.InputMovement(new CharacterMovement(vectorToPoint, walkSpeed));
    Sec Way : select the CharacterAnimator and press Ctrl + D
    now put CharacterAnimator 1 to the AI so you can keep CharacterAnimator for the player
    then go to walking animations in animator> base layer > Walkunarmed and walkarmed
    now select each run animation in the blend trees and change the speed to 1 from 1.2 or 1.1
    you can lower as much as you want even 0.8 will work without looking slowmo
    Last way the easy one :
    if you hate all of this script animations edit , select the ZeroFriction on the Capsule collider of the character
    and change the Friction to 0.1 or more Test in real time to see what speed you want .
    cheers
     
    f1chris likes this.
  9. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    256
    take a loot at puppet master, i'm considering buying it to add ragdoll effect, it seems pretty solid ! let me know if you get it first !
     
  10. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Good.
    My problem is I want the player to move faster but without changing also the animation speed...
     
  11. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    select the rigidbody of the character and play around with it , example : interpolate change it to extrapolate that's one solution ,
    the other is the walkspeed in the script
    By changing movement = _currentMovement.Magnitude * overallIntensity ;
    To
    movement = local * walkspeed; in character motor script


    1. if walkspeed is missing add
      public int walkspeed ;
      and change it in the script to above 1 . i did not test it ,
      but until the dev makes the movement based on the keyinput and not based on animation.
      i will work around it and post any new scripts to do that
      my idea is to make the player move with transform gameobject , and make the animation just do nothing and play without moving .
     
    angel_m likes this.
  12. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Thanks for the help. I agree with you about the changes needed. I hope the dev to modify it.
     
  13. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
  14. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Last edited: Dec 11, 2017
  15. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    yes because its root motion system speed and direction comes from animations. it looks more natural than other methods, and before there was no such parameter to control specific characters speed.
     
  16. eliteslayer

    eliteslayer

    Joined:
    May 12, 2013
    Posts:
    64
    is it possible to make the speed change based off of the different Ai states? or sometimes randomly for the sake of it as well. Ex: wandering slowly and walks and then decides to run or jog for whatever reason randomly, or they jog to a location because of a possible warning or a sound or possible sighting they might have come across. Thanks.
     
    angel_m likes this.
  17. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    I'm loving it , did you add something to the AI , it looks better . good job , i can't wait for the update and for this to be on unity awards nominees.
     
  18. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    Yes , and Rotation , like the AI turn to look at a direction
     
  19. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    We dont have UI thing for that but its easy to code now randomness.
     
  20. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Thanks for kind words! helps to get up and continue every day :)
     
    Rahd likes this.
  21. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    those are last features (eye candy)
    now I need to update documentation create a new trailer for 1.4
    and push to the store.

     
  22. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    256
    better and better everyday !!!
     
    EduardasFunka likes this.
  23. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Is high grass zone increasing discretion ?
     
  24. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    sorry, I don't speak English that good to understand in lawyers terms :) can you rephrase?

    It works this way.
    You press crouch button and you inside grass zone enemies cant see you.
    You release crouch enemies see you.
    You shoot. Enemies need to come closer to see you, they will go to your position.
    Enemies will see you in the grass if they alerted and they near you.
     
    Last edited: Dec 14, 2017
    zenGarden likes this.
  25. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I am also not native english lol
    Special grass zones is a very new feature, like "horizon" game in some way, great.
     
  26. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    I like it! Very Horizon Zero Dawn...(y)!
     
  27. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    Hi @EduardasFunka

    when are you planning to upload your next update ?
     
  28. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    tomorrow end of the day. All done just need graphics for the store.
     
  29. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    Oh cool. Hope you’ll post the release notes here as well.

    Thx
     
  30. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi @EduardasFunka

    Will AI behaves good when there are lot of AI and there is no covers in the level ?
     
  31. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    this not something I tested as its a cover shooter. We have an option for AI to ignore covers and be aggressive. will test later and update you.
     
  32. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    here is our tutorial for AI (1.4)
     
  33. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
  34. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Great :)
    I got some open areas with trees, the AI should be behave like in the video.

    I still have some questions until the update is available and i can test it.

    Instead of "side" in scripts, why not using "team" or "faction" ?
    1) Can you define more than two teams ? For example one team if friendly with the player team id, while two other teams would be hostile to player team ?

    2) Can the AI work with non bipedal characters like moving turrets ?

    3) Is melee AI possible like berserk character and dogs ?

    Will you demonstrate setup player with a different player controller ? like Unity standard Tps controller for example.
     
    Last edited: Dec 18, 2017
    angel_m likes this.
  35. munimraza

    munimraza

    Joined:
    Sep 23, 2017
    Posts:
    9
    I just upgraded this asset and in third person mode the character takes jerks (feeling like adjusting the rotation again and again) in the start and happens frequently when you stop moving. You guys have done good work but this is seriously annoying.
    I am using Unity 2017.1.1p1 and this is happening in the demo scene.
     
  36. munimraza

    munimraza

    Joined:
    Sep 23, 2017
    Posts:
    9
    Something is wrong in character motor script. The blue sphere (in gizmos) being drawn between feet starts flickering left and right. Making the character goes mad.
     
  37. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Hi,
    it looks like some unity version problems that we have not tested on. I will test now on 2017.1.p1 and give you feedback. Right now I am running on 2017.2 and it works flawlessly.
     
  38. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    and now 2017.3 is officially released. Used to work with it for over a month without any specific issues with your asset.

    We should expect 1.4 release today. Normally it takes a few days max to review and update.
     
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Is the mobile update coming ?
     
  40. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    Hi , i'm not sure if this happens to me only but i made some changes to the animator and i wanted to share it with you guys :
    so when aiming the gun on the 1/8 of the mobile joystick the character will go nuts , sometimes thru walls . or teleport if the frames are too low .
    Fix
    on the Base layer stand armed , change the turn tree to this (from -20 to -50 , 20 to - 50 )
    and do the same on the walking armed and (stand/walk)unarmed , if it has the same issue.

    animations that dont change the player positions like turn rifle should have a baked position.
    bellow you will find the before and after results cheers.

     
  41. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Thanks @munimraza I found that bug it's not unity version related. But it appears at low fps for me.


    The motor detects rotations around the Y axis and attempts to display animations that reflect such movements. The code needs more tweaking and fixing to make it work in the low framerate situation. We are also going to optimize the whole system a lot more.
     
  42. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467

    Thanks Will investigate!
     
  43. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Yes but now I'd like to cancel new version and fix that low fps bug if you guys don't mind
     
  44. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    why not just let it go and release a hotfix once found ?

    I'll be honest with you, I like your asset. I switched from another one to yours to pursue my project. But it's a bit difficult to follow where you're at sometimes. When you're in a middle of a game, any new release takes time to integrate and it's crucial to know when something big is coming so we can align our development based on that.

    By example, I worked on in last few days on something not controller related because I'm expecting you pushed your update to the store as you said on Friday. Once we have access to it, integration will take some time. Even if a bug exists, I can live with it. Just release a hotfix or post something in here.

    I love what you're doing @eduardas but the reality when you're are seriously developing a game based on some assets here can be frustrating if things like that happen. I understand most here are just experimenting with it but for those of us doing game development as a living, a bit more transparency would be welcomed.

    thx
    Chris
     
    zenGarden likes this.
  45. EduardasFunka

    EduardasFunka

    Joined:
    Oct 23, 2012
    Posts:
    467
    Hi, what do you mean more transparency? I take this asset also very seriously and respect my clients how you want us to improve on transparency?
    Version no canceled it just me I hate to push something when I know there is a bug.
     
    Last edited: Dec 20, 2017
    julianr likes this.
  46. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    i know you're taking it seriously. Take my comments for what it is, not beyond that. I only meant by transparency to let us know when it's officially pushed to the store and something is coming and some kind of release notes in advance so we can schedule our workload based on what area will be impacted. I loved what you did with your videos recently but you also mentioned of couple of things to be delivered and we don't know if they will be in it. I have no problems at all if something mentioned before is not making the cut. It's the nature of software development. I would suggest a little communication when a release is pushed to the store and waiting approval with a release notes. Not more. This is what other content developers are doing and it's working just fine in terms of expectations.

    I understand you don't like to release something when you found a bug. Unless it's something really major, we can deal with it. And sometimes we may help to find out the solution and post a quick fix here ( maybe just a few lines of code changes required, who knows). Don't be afraid to post solutions here ( if possible ) and later on release the fix.

    Keep up your good work
    Chris
     
    Last edited: Dec 20, 2017
    angel_m, zenGarden and EduardasFunka like this.
  47. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    Same BUG i just posted a fix to it YOU NEED to bake the animations on XZ for idle and standing
    for the walking and other movement animation . You need to Make the movement based on the script not the animation
    i will explain more :
    when you press W or move the joystick on mobile
    the animator takes the input of the game controller in the update function (that is frame based) so the lower the frames the slower that update will work .
    To fix this you need to make the animator just play animations and bake the movement animations on XZ
    when you do this the character will walk But never change position.
    To make it move you need to transform the position Based on the the game controller input .
    this will make our life easy and your's too :)

    as even if the frames are low the character will not jerk around .
    i had this bug on mobile for a while , lucky i'm keeping the Frames targer always at Fixed 40 fps , but once it lower than 30 that bug you just showed happens with collider ignore and teleporting.
    plus you will not face slowmotion animation if you change the walkspeed ,
    I know this is too much to ask , buy please look into it and see if it's worth it .
    Please do ask any question if i'm not clear .


     
    Last edited: Dec 21, 2017
    angel_m and zenGarden like this.
  48. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Yes, please, make the movement independent from animation speed.
     
    Rahd and zenGarden like this.
  49. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    You can push it, as we can already test it without putting attention to this existing bug and we can already test the new AI.

    Also it looks like it won't be a common third package, the common AI only plugin finally.

    Is top down plugin getting some polish and be usable as top down PC game with joystick or mouse-keyboard ?
    It doesn't make sense it would be mobile only when it comes to top down games :eek:
     
    Last edited: Dec 21, 2017
    Rahd and f1chris like this.
  50. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    256
    Lots of other dev open up beta build for buying costumer so we are free to update or wait for another official release. This will help you find and maybe fix some bug faster. I prefer to wait and have less integration iteration of such a huge asset. Good work, it really is the best controller on the store