Search Unity

Character System

Discussion in 'Assets and Asset Store' started by RobinS, Jul 13, 2012.

  1. RobinS

    RobinS

    Joined:
    Sep 2, 2011
    Posts:
    417
    hey mcconrad,
    Thanks, i'm still testing and will investigate this further. Does anyone else experiencing the same? On my end it is working without problems. (iMac-2011-Unity Pro 4.3)
     
  2. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I have collision problems when I have the Animator tab open and I am running the game. Close it down or make a build and I have no problems. Have no idea why that happens.
     
  3. RobinS

    RobinS

    Joined:
    Sep 2, 2011
    Posts:
    417
    Awesome! thanks, that helps a lot.
     
  4. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    yah everytime the animator has root motion take over during jump and evade clips, almost 100% of the time i can go right thru colliders of any kind, and even triggers that have a -transform.forward force to the rigibody with massive numbers will be ignored during those clips. i can post a youtube video if you like or provide you login info for my game so you can see it happen in real time.

    edit: i am also running my game in webplayer mode, fyi. that might be a variable not yet taken into account, despite my physics settings being at the highest level.
     
    Last edited: Jan 7, 2014
  5. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    @RobinS ,
    This is also occurring (although with much less priority) during the WallGround() calls from heroctrl.cs. at any point during these animation clip cycles, if the raycast goes through the collider due to the inherent root motion of the clips ("WallHigh" "WallLow"), angle of impact, distance to the collider, the player can clip the collider surface and penetrate it.
     
  6. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Where can I find the documentation that is supposed to be included with Character System? I can't seem to find it.

    Also, is there any reason why my player keeps getting stuck to a wall if she jumps on one?
     
    Last edited: Jan 12, 2014
  7. Lucas-mv

    Lucas-mv

    Joined:
    Nov 17, 2013
    Posts:
    8
    I have the same issue with:
    - Backwards / Forward evade
    - Right click sword hits 2 and 3

    This seems to be affected by:
    - Movement speed (Higher speed causes less collision detection)
    - Fixed timestep (On edit > project settings > time). The lower the fixed timestep, the better the collision, but lowering it hurts performance as it seems to mean more physics calculations per frame.

    Best regards
     
  8. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    I'm trying to modify this camera script from the Character System asset in the Asset Store so the camera only moves when the right mouse button is held down. Where is the best place to insert the if (Input.GetMouseButton(1))?

    http://pastebin.com/Cc6miv8T
     
  9. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    The docs is a pdf that is in one of the durectories under the _charactersystem just look for it through explorer.
    The thing about the walls it is known already if you read up people are trying to come up with a work around as Robin also is working on it.
     
  10. RobinS

    RobinS

    Joined:
    Sep 2, 2011
    Posts:
    417
    Hi,
    Thanks, it seems to be caused by the combination of Mecanims root motion and adding additional forces/velocity to a moving objects rigid body. That, low frame rates and high speed can make your character move through colliders. Until this is fixed on the Unity side, you could switch to an idle or stop animation state(zero root motion), while having an impact or by adjusting speed values, cap max velocity or similar systems to prevent this.
    I answered your questions per email. (link included)
    Thank you very much, i came to the same conclusion, but only on a windows machine. Please see answer to Mcconrad above.
    You would have to use this condition in HeroCtrl (Character rotation ; see canRotate references boolean) and in HeroCamera (Camera rotation ; line 200)

    Thanks @Archania
    Cheers!
     
  11. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Do you motions work with UMA?
     
  12. RobinS

    RobinS

    Joined:
    Sep 2, 2011
    Posts:
    417
    Yes, you can retarget them like any other bipedal animation, thanks to Mecanims retargeting ;-)
     
  13. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Also, is there any way to make the evade animations more responsive? Typically in games where the player can evade, the moment the doubletap happens, the player evades. It seems like with Character System there is some sort of delay?
     
    Last edited: Jan 14, 2014
  14. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    there is a built in delay for input, cooldown, and the animation clip itself. you can easily edit the delay from heroctrl.cs on the following lines:
    Code (csharp):
    1.  
    2.     public float doubleTapSpeed = 0.2f; // Time between the taps frames*2
    3.  
    4.     if(canEvade) // Double Tap - Evade takes tapSpeed  coolDown in seconds
    5.         { if(!isDoubleTap) StartCoroutine (DoubleTap (doubleTapSpeed, 2));      }
    6.  
     
  15. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    I saw those lines in the script. I know the cooldown delay, but I mean the general responsivenesss of the evade itself.

    I believe the doubleTapSpeed float is used to determine whether a key is double-tapped (the key has to be pressed twice within 0.2 seconds) or not. I don't think it actually modifies the response time.

    When the player double taps to evade, it should happen immediately. I'm trying to figure out where the delay between keystrokes and animations is occurring and then make that delay shorter. This isn't just for evade though, either. There is a delay between every change in animation/keystroke, and it makes the player character have slow response times compared to most modern games.
     
  16. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    ah well in that case, you should check the transition timing in the animator. you can probably trim it a little on the in/out transitions to the evade animation clips.

    in response to EVERY key having this issue, that came up in previous posts and ended up being a delay in the preview player that did not occur after build.

    i myself have never had any response time issues with this system.
     
    Last edited: Jan 14, 2014
  17. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    I think we might have different standards for response times. I am using the default CS system and even when using the demo scenes that came with CS, people have said the delay between keystroke and response is noticeable compared to modern-day games. Most gamers like snappy controls.

    The delay still persists after building, and from my experience there is no difference between what I see in my preview player and the final build.

    For some odd reason, I get an error when trying to reduce the transition times, and this causes all the transitions to remain at default pace. I am running on Windows Vista, so that might be part of the issue.
     
  18. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    well my game is a jumping adventure and combat game so timing is crucial when a key is pressed and action occurs, and i have not experienced such issues (aside from the sprint tree which had some missing transitions). i have never had the preview vs. build delay, but i was just relaying what previous posts had said about a similar issue. i have extensively modified the default cs system, so i might have inadvertently fixed such things awhile back, but if you want me to see if i can help, either PM me with a skype handle or youtube video that shows the delay and i will see what i can do. i didnt write the system, however, so i am not saying i can fix whatever ends up being the issue, and it may well be that vista is the culprit, being a decades old operating system that was never fully supported anyway. but let me know if i can help.
     
  19. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    @RobinS have you gotten a chance to look at this issue yet? it is actually more pressing than the evade bug because this allows players to float up terrain and colliders that are there specifically to prevent them from being able to reach certain areas (e.g. invisible walls), but instead is making it *easier* to get to them by allowing them movement +y while floating.

    in a previous post i mentioned that the quick fix (disabling all movement input while falling) cannot be used because that would prevent players from aiming while falling in all areas, and really i just want them to stop being able to ride up a slope greater than x degrees.

    thanks!
     
  20. RobinS

    RobinS

    Joined:
    Sep 2, 2011
    Posts:
    417
    I couldn't reproduce this, works as expected here. Have you tried to use Debug.log or print to find the source of this in your code ? I you just want to prevent players to move you could pass 0(zero) instead of the actual axis on the movement layer ( Where the movement is applied ). This will leave other functionality input related "untouched".

    Cheers.
     
  21. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    i sent a reply via PM.
     
  22. Dagarath

    Dagarath

    Joined:
    Apr 17, 2013
    Posts:
    16
    I have been looking at this and it looks phenomenal, is there a way you can use this with a different camera? I have UFPS Camera, already purchased it a month or two ago, curious before I make the leap to grab this if I can easily mesh the two because I think that would be absolutely amazing!
     
  23. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    I use a custom camera system. If you can program, you should be able to without a lot of issues. Issues meaning by making sure everything works correctly. I wouldn't assume that you could just attach it and be done.
     
  24. Dagarath

    Dagarath

    Joined:
    Apr 17, 2013
    Posts:
    16
    So I should be fine with just linking the current HeroCam code to UFPS (obviously more complicated) sweet.
     
  25. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Just keep in mind that you might have to edit the scripts in order to make them work together. Cause if it doesn't work, I clam the 5th. Lol
     
  26. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    I don't think it will be quite that easy with UFPS, since for starters it's designed for first person games, unless you plan to waste the third person capabilities of Character System on a game that doesn't need them. The other really big issue is that UFPS is not just a camera. From what I've seen, it incorporates its own character controller, and weapon animations as well. You'd need to throw all of that out, and integrate the camera specific parts of it with Character System, without breaking its core functionality. If you succeed, great, but expect a few hurdles along the way.
     
  27. Dagarath

    Dagarath

    Joined:
    Apr 17, 2013
    Posts:
    16
    The third person capabilities are all going to be for 3rd parties (other players) and reflections, there are mirrors and such in my game.

    I am after really only the animation properties of Character System, works well with it's first person camera from my testing, I just want it to work with a different camera.

    UFPS does have a character controller yes, and that is why I bought it was for the awesome stuff it does do.
     
    Last edited: Jan 25, 2014
  28. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    So is it a multi-player game, or are you going to use Character System just for AIs? It sounds like you want to use UFPS to present your POV in a FPS style, but have a separate full Character System avatar for reflections, and other players to see. That would be cool, but sounds pretty complicated to get the two versions of your player fully synchronized. It seems more efficient to just use the FPS view from Character System, enhanced by some of the UFPS Camera effects. Too bad there isn't a U3PS Camera System, so you could get the camera features without duplicating things. If you get this working, I'd love to see a webplayer demo to see how it looks.
     
  29. blaize

    blaize

    Joined:
    Jul 25, 2012
    Posts:
    41
    I'm looking at this system, and was wondering if the character can be thrown when hanging on a ledge?
    Like in Shadow of the collosus, when the monster moves/shakes to hard the player falls of.

    If this feature is supported, of easy to add this will be an instant buy for me! :)
     
  30. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    seems pretty easy. you would just turn on the ragdoll at the moment when you want player to lose control and become controlled by gravity physics. then it can fall, or be thrown about or whatnot.
     
  31. blaize

    blaize

    Joined:
    Jul 25, 2012
    Posts:
    41
    Yes, that part is easy. but when/how the player loses it's grip is the harder part i think.
    You would have to measure how much force the player experiences, and set a 'break' limit which triggers ragdoll.
     
  32. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    well you could just made an empty child object of the player, turn it on only when in climb state, then if it receives a jolt in the x or z directions (compared to the smooth transition while climbing), then have that trigger the ragdoll
     
  33. shadow-river

    shadow-river

    Joined:
    May 29, 2013
    Posts:
    63
    just wanted to know if anyone could tell me if the animations
    are walk in place, or root-motion.

    thanks in advance.
     
  34. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Has anyone had issues with their character getting stuck mid-air after jumping or falling from a tall surface or hill?
     
  35. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    yes, this (usually) has to do with transitions from states that are possibly missing, depending on your situation. go thru all the air state trees and make sure the transitions from air to land to movement are there. you can also pause the game when you get stuck like that, click on your player and open the animator and it will show you what state it is looping in and cannot get out of.
     
  36. MinhDao

    MinhDao

    Joined:
    Oct 28, 2013
    Posts:
    155
    I found serious problem in this system. My picture below show it! Can you fix it?
    $Screen Shot 2014-02-03 at 3.15.56 PM.png
     
  37. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    MinhDao there are settings in the HeroCtrl that will adjust the distance.
    I believe it is the Climb Offset To Wall.
    This is something that he can't fix simply because he didn't create your climbing boxes.
    So play around with the numbers and see what you like.
     

    Attached Files:

  38. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    and remember the numbers are relative to the PIVOT of the collider!!! very very important that it be at the top edge nearest to the player, and z facing inwards.
     
  39. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    Any update on the terrain collider/sliding up bug? It has been a few weeks since I received a reply.

    thx!
     
  40. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    They seem to be there, but you're right in that one of them is looping and I can't get out. In the jump tree, there is a transition from AirTree.JumpTree -> AirTree.FallTree that is basically a falling animation with an exit time of 0.68. This seems to match the amount of time in which my character gets stuck in mid-air after jumping off of a large hill. Any idea how to fix this? Increasing the exit time to something like, 200, causes the character to fall longer, but more straight down than forward (you would still move forward in a realistic forward jump).

    EDIT: I found a transition from the FallTree to the Land animation, but the parameters are Grounded = True and CanLand = True. I'm not sure where to find the CanLand distance. Grounded will never be true as long as my character is stuck in mid-air. Any assistance in debugging this matter is appreciated. I can't be the only one who has had this issue!
     
    Last edited: Feb 4, 2014
  41. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    well first what are you trying to accomplish? when it is looping in that particular tree it means !grounded (i.e. he hasn't landed or hit ground yet) so it should always loop until that condition occurs. both canland and grounded are booleans not distances (i.e. they are either true or false). i mean, is he just hovering over the ground? that means your grounded distance variable in hCtrl is not set to the model's height(ish)
     
  42. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    This is what happens: http://imgur.com/fztc6VO (the character is literally frozen in mid-air)

    The animator shows the character enter the JumpTree after jumping off a cliff but then the animator stops. As in, it doesn't go into any other state, and there isn't a moving blue line (like there normally is in the animator) anywhere in any tree.
     
  43. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    well i don't see any ground, so did it hit an invisible collider? if your grounded distance is not set right, it could just be hovering over the slope. see how grounded is checked? that means the character has landed. so either the ground is not tagged as a valid layer (climb, player, ignore colliders, etc. are not valid landing layers) or your grounded distance is off or you are on top of an invisible collider that is not set to trigger.

    also you are not in the right tree to see what state the player is in, that is why you arent seeing the blue progress bar. the character is in a different anim tree
     
    Last edited: Feb 4, 2014
  44. MinhDao

    MinhDao

    Joined:
    Oct 28, 2013
    Posts:
    155
    Thank Archania for your answer!
    I increased Climb Offset To Wall to fix this problem. But then, i met other problem. My camera is top down, so player can see the distance between hand of character and wall. Here is sample picture. Can you help me? :D
    $Screen Shot 2014-02-04 at 9.05.34 PM.png
     
  45. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Hmm now it looks like you went too far. Ahhh hmm you can also try to push/pull the climb box collider to see if that helps. It is a picky thing to get absolutely correct because the climb colliders are independent of the geometry so getting them all in the correct place is going to be very time consuming so you don't have any clipping issues of the models hands.
    Up to you on what you will accept. Good luck.
     
  46. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    I exited my current tree and there isn't a blue progress bar being shown anywhere. My guess is that there is no anim state tree that it is currently in.

    I'm looking at the area in my scene view and the character collider is touching the ground because it doesn't shrink or conform to my character in mid-air. How would I go about fixing this? Is there a way to modify the collider only when it's in the air? http://imgur.com/pmSOLri
     
  47. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    it is always in some state, you just need to find which by going thru the trees. but since that is not the issue, but rather the collider size, let's just fix that part. the fixed part you want to comment out is in void start() in hCtrl.cs on the lines with col.height = 2.0f; etc. just put // before them and the script won't resize it at runtime.

    yes you can resize or reorient the collider anytime you want but it will probably work fine once you resize it prior to runtime to the correct scale of your figure. if it doesn't and you still need to adjust it during runtime, that col.height = 2.0f; is what you want to change. just add that (to whatever value you need) to the jump functions (and the opposite to the reset jump function, or anywhere you get grounded == true). make sense?

    looking specifically at the numbers in the pic, i notice you have scaled your figure to 1.55x but not adjusted the collider height or center (remember to comment out the above parts so it wont change at runtime) and probably the grounded distance needs to be adjusted too.

    also, it is usually best to prescale the model prior to adding colliders. meaning in the import settings area, change those numbers rather than in the transform section. it just ends up being cleaner for unity's math as scaling can have some ... difficult side effects.

    and one more thing, lol. the "isKinematic" button is checked in the rigidbody and that can also cause floating when jumping because it means external forces will not impact it (more or less), including gravity (despite the checkbox above it).
     
    Last edited: Feb 5, 2014
  48. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    I've made the changes. It seems like col.height is automatically commented out in the latest version. I checked out the isKinematic issue and I think that's it. Whenever my character jumps or falls from a large height, it freezes in mid-air and the isKinematic box is checkmarked by the script. If I uncheck it manually, the character continues to fall and then hits the ground. Do you know what might be causing isKinematic to automatically be checked?
     
  49. mcconrad

    mcconrad

    Joined:
    Jul 16, 2013
    Posts:
    155
    make sure you have correctly set up a ragdoll if that box is checked.
    the climb states will set kinematic to true, as will ragdolling.
     
  50. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    What values do you typically use for total mass and strength?