Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Bone Controller [RELEASED]

Discussion in 'Assets and Asset Store' started by Tryz, Feb 16, 2015.

  1. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    69
    Hi Tim,

    I'm thinking of picking up the Bone controller, I see it's on the sale. Sent you an email earlier, but thought I'd just post this here instead.

    Anyway, my character has some transforms over the bind joints(bone) itself. These transforms don't have any influence on the skin at all, it's just sort of an extra rotation above the bone. Will BC be able to access those (or see? - I noticed in the video that they become visible in the editor. Is that the only way to access them?).

    I noticed you have a video demonstrating the finger pose motor. Is there a video somewhere that shows how to setup the pose motor itself (associating bones, etc is what I'm wondering about), or is it not that different?

    Thanks in advance.
     
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Hey @rubble1 ,

    You can use the Pose Motor to put the character in a specific pose. However, it's not like a full animation (ie multiple frames). Think of it as a single frame in an animation.

    When you tell the BC about the root of your character, it will find all the bones in the character and then you can access them all. Sometimes the bones may be tiny, but they are there and they can be posed.

    The easiest way to access them is through the editor. You can write code to find and rotate the bones, but then you'll have to deal with the rotations.

    It doesn't look like I have a video on the Pose Motor itself. Basically, once you select a bone you can use a standard GUI tool to rotate it.
     
  3. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    69
    Sweet! I just tried it out, and it looks like it's going to work for what I'm trying to do.
    That was quick.

    Thx Tim.
     
    Last edited: Dec 9, 2017
    Tryz likes this.
  4. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    69
    Ok, one thing that did pop up. Is there a way to translate the bones to a new position?
    I am using the pose motor, so far the rotation has been great for just about everything, but I do have a special case where I need to change the position of some of the things.
     
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Unfortunately, no.

    The BC was built as a way of managing skeletal bones for characters. So, all the bone "roots" are fixed to their parents.
     
  6. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    69
    Oh ok. Well it's better than where I was before.
    Is this a Unity thing or a BC thing?
    Is there a way to "unlock" these properties somehow? Maybe through a custom motor?

    Also, just going through this I did have a small usability suggestion.
    Sometimes it just takes a while to find the bone in the IK bone list, and then scroll all the way down to the bottom of the menu to add them. Do you think that maybe it could be faster if you had an "add" button right there next to the label of the bone? Same thing with the on the IK motor properties. Sometimes I realize there's a bone I didn't need there after all, it'd be nice to just hit a little "minus" button to get rid of it, rather than scrolling all the way down the list.
     
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    A BC thing.

    With changes to the BC, you may be able to get this to work. However, you'd have to reset the bind pose the child bone originally created when we assigned the skeleton to the BC. Then, you'd have to provide access to move the bone vs. just rotate it.

    It's doable and probably not a lot of code, but complicated as we're dealing with quaternions and bind poses. Unfortunately, moving bones just wasn't a feature I planned for (since real human bones don't move). :(

    That makes sense. I'll add that to my to-do list. No good estimate as to when (my list is pretty long), but I like it.
     
  8. Vanidash-Studios

    Vanidash-Studios

    Joined:
    Mar 9, 2016
    Posts:
    71
    Hi, is there a way to smoothly transition from limit to limit? i'll post a youtube video showing what i meant, because right now im facing like a snapping "problem".


    i would like the head to turn slowly back to the other limit instead of a quick snap

    Sorry if this is explained in the manual, but i cant figure it out.
     
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Try checking the motor's "Use Fixed Update" option. That will now have the motor process at a consistent time and it helps the look be smoother.

    You can then go to the bone entries in the motor and you can change the "Rotation Lerp" to make it slower or faster.

    Personally, I thought checking "Use Fixed Update" and keeping the "Rotation Lerp" values at 0.1 looked pretty good and was still responsive.
     
  10. Mythcons

    Mythcons

    Joined:
    Mar 16, 2017
    Posts:
    4
    Greetings,

    I've been trying to set up the Bone Controller so that my character's feet connect with the floor. I looked at your YouTube tutorial for the Foot to Ground Motor, but when I try to replicate what you are doing, my character's legs go wild and do not revert back to their previous position when moved away from the floor.
     
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    From the looks of it, a couple of things might be happening:

    1. You may not have assigned the "Root Transform" in the Bone Controller when your character was in the bind pose.

    2. You may not have rotated the leg bones as I mentioned in the docs and video.

    Given what I see with the arms and legs, it looks to me like #1 is the problem.

    Make sure your character is in the bind pose (T pose I'm guessing) when you assign the "Root Transform".


    Also, the BC won't cause your legs to "revert back to their previous position". Your animation does that.

    If you think about the way Unity processes animations and bones, it goes like this (for each frame):
    1. Process animation to get current frame
    2. Apply animation frame rotations to the bones
    3. Run bone FK/IK to rotate bones beyond animation
    Next frame, repeat...

    So, the animation "clears" the bone rotations and reverts them to the right position. Then FK/IK modifies that position.


    If you've confirmed you've followed the docs and video, feel free to email tim@ootii.com a small project and I can take a look at your setup. However, the issue always turns out to be #1 or #2. :)

    Please include your Unity Order ID in the email. This way I can track who I'm providing support to. Thanks.
     
  12. Vanidash-Studios

    Vanidash-Studios

    Joined:
    Mar 9, 2016
    Posts:
    71
    works like a charm, THANK YOU!
     
    Tryz and hopeful like this.
  13. f1ac

    f1ac

    Joined:
    May 23, 2016
    Posts:
    56
    Hi @Tryz, I have an issue with my test character. I cannot make it sink into a ramp in order for both legs to be positioned correctly. One leg always remains in air in play mode:
    bc1.PNG
    I use motion controller with default adventure settings, bone controller with default settings and two foot to ground motors, and a Mixamo character imported with default settings. Foot sphere is disabled on ground and ramps.

    In scene view both legs are ok, in play mode on steps they are ok too. I've tried to tweak all suspicious Actor controller settings, but it didn't help. Am I missing something?
     
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Hi @f1ac ,

    The MC doesn't have any feature to sink into ramps. Unfortunately, this is a problem that even games like Assassin's Creed Origins have.



    I went ahead and put together a post that talks more about this. Hopefully it will help:
    Foot IK and Ramps
     
  15. f1ac

    f1ac

    Joined:
    May 23, 2016
    Posts:
    56
    @Tryz , Thank you, I was under the impression I'm doing something wrong.
     
    Tryz likes this.
  16. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    147
    i heard there might be MegaSplat integration, is that forthcoming?
     
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Unfortunately, it's not anything I'm working on right now.

    There was some early work done, but the approach caused the feet to wobble way too much. I didn't feel comfortable releasing it as part of the BC.
     
  18. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    147
    Thanks for hitting me back about this.
     
    Tryz likes this.
  19. myownbot

    myownbot

    Joined:
    Mar 30, 2017
    Posts:
    22
    Hello everybody!

    Anybody had troubles with RotationLerp? No matter if it is set as 0, 0.01 or to 1, the rotation toward the target occurs instantly.

    ootii! It was my best investment of US$50 since ever!
     
    Tryz likes this.
  20. myownbot

    myownbot

    Joined:
    Mar 30, 2017
    Posts:
    22
    Oops! The solution was found a couple of posting earlier.

    FixedUpdate fixed that!
     
    Tryz and hopeful like this.
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    hahaha... That's the way it happens. :D

    Glad you found it.
     
  22. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,945
    Hi, sorry if this has been asked before. I can't search this topics as the words are too small apparently.

    Is Bone Controller compatible with UMA? I assume i'd need to add the components at runtime after spawning?

    Thanks
     
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Hey @derkoi ,

    It can be used with UMA and I know some people are, but like you said the bone motors need to be setup at run-time since the UMA skeleton doesn't exist at edit-time. That makes it a bit more complicated as you have to do some things through code that I do for you in the editor.

    If you want do to this, looking at my editor code will be a huge resource. I'll be happy to point you in the right direction too. Just expect there to be some coding involved. :(
     
  24. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,945
    Thanks for the reply. I'll give it a shot. :)
     
    Tryz likes this.
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    If you need help, just email tim@ootii.com.

    Please include your Unity Order ID.
     
  26. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,945
    Thanks, will do!
     
  27. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    664
    @derkoi, @Tryz - the current version of UMA (2.7) has a Bone Builder tool that will generate the UMA skeleton at edit time. The last time I tried it out (using an in-development version from GitHub), I was able to use Bone Controller on the UMA character the same as any other skinned mesh.
     
    derkoi and hopeful like this.
  28. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    1,945
    Thanks. I'm aware of the bone builder tool but I'm using Realistic Eye Movement which for some reason requires I build the UMA skeleton at runtime, otherwise my characters look at the floor.
     
  29. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,459
    Can't you just use REM like you would for a regular character, using the UMA bone builder, and skip trying to tell REM that it is being used on an UMA?
     
  30. Djayp

    Djayp

    Joined:
    Feb 16, 2015
    Posts:
    14
    Hello !

    First, as it is my first post here and bought it yesterday, thank you for this asset which is a huge time saver.

    I'm trying to achieve a first person controller (I mostly bought this asset because I want real time melee and need something to easily move the arm ; foot placement was a plus). I saw there are interfaces : IInputSource and ICharacterController. Reading UnityInputSource, it was fairly easy to understand how IInputSource worked and why it was there, but as far as I could understand, there is no sample implementing ICharacterController in this package. I don't want a full implementation of a FPS controller, in fact I wouldn't be asking if there was a simple documentation about this interface.

    1 - Are there free implementations of ICharacterController, documentations or tutorials I didn't find ?
    2 - From thoses you made, which are the most suitable assets for FPS ? I am about to buy your Camera Controller since there is a Character Controller folowing your interface too.
    3 - Do you have any advice-trick-shortcut about real-time melee ? I think I'll be using BS Melee Combat System
     
    Last edited: May 4, 2018
  31. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    318
    Hi, getting some errors if i import this asset in my project:

    Assets/ootii/Framework_v1/Code/Data/Serializers/JSONSerializer.cs(333,25): error CS0117: `Log' does not contain a definition for `ConsoleWriteError'

    Assets/ootii/Framework_v1/Code/Utilities/Profiler.cs(342,25): error CS0117: `Log' does not contain a definition for `ScreenWrite'

    Assets/ootii/Framework_v1/Code/Utilities/Profiler.cs(350,21): error CS0117: `Log' does not contain a definition for `ScreenWrite'

    Using Unity 2017.4.4f1.
     
  32. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,459
    Just so you know, @Tryz just departed on vacation (which he mentioned in another thread), so he'll get back to you but maybe a little slower than usual.
     
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Thanks @hopeful !

    @unicat , that is a namespace issue. You have another class in your project named "Log" that is not using namespaces.

    That bad class is overriding my class. Please find the bad "Log" class and have the author use namespaces like every good programmer should. Otherwise no one in the entire world can use the name "Log".
     
    TeagansDad likes this.
  34. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    318
    Thank you hopeful and Tryz. I will try to isolate that asset.
     
  35. CommunityUS

    CommunityUS

    Joined:
    Sep 2, 2011
    Posts:
    147
    https://github.com/stella3d/job-system-cookbook/blob/master/Assets/Scripts/RayBoundsIntersection.cs

    Perhaps the new ECS will allow us to achieve this with little cost. Besides awesome coding. Any chance you would revisit this year and try to do what even triple A games let slide? :)
     
    Tryz likes this.
  36. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    I'll look again. I'm a bit swamped with some client work right now, but I'll add it to my to-do list.

    Fair warning... it's a long list. :)
     
    CommunityUS likes this.
  37. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,249
    Get this error when importing the latest Bone Controller version in Unity 2018.2 0f2 :

    Assets/ootii/Framework_v1/Code/Geometry/QuaternionExt.cs(313,29): error CS0029: Cannot implicitly convert type `void' to `UnityEngine.Quaternion'
     
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Hey @RandAlThor ,

    Unity 2018.2 added a function they didn't previously have. That function is colliding with one of my functions. I sent a fix up to Unity on the 13th, but it seems to be stuck in limbo. On Saturday I left a message with Unity to see what's going on.

    Until that gets release, here's the fix:

    In QuaternionExt.cs, change line 313 from this:
    Code (CSharp):
    1. rTwist = rTwist.Normalize();
    to this:
    Code (CSharp):
    1. rTwist = rTwist.normalized;
    I'll contact Unity again.
     
    twobob and RandAlThor like this.
  39. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,249
    Thank you Tryz :)
     
    Tryz likes this.
  40. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    The developers 'unstuck' the update and it's now live.

    I'm sorry for the inconvenience.
     
  41. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    124
    Hi @Tryz - I just deleted my last post here as I made a stupid mistake trying to setup BC with my Lion character. Just mentioning it in case you saw it. Anyway, I'm going to try the foot motor with each of the lion's legs and see what happens. I know it's not designed for it, but it will be interesting. Maybe after that I can see about creating a motor that will work for the Lion.
     
    Tryz likes this.
  42. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    124
    So far, the lion is not dropping down on the front end when I have it walk down a hill. Since I'm using MC I don't have to worry about the collision capsule preventing contact with the ground, right?
     
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Correct.

    With something that's long like an animal you may want to set the AC's "Orient To Ground" option. That will have the character respect the terrain pitch. From other posts, I think you've used that.
     
  44. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    124
    Yeah I had thought I could disable the "Orient to Ground" option and that the lion's front legs would then "fall" forward until they made contact with the ground. The end goal I'm shooting for is to:
    1. Not have the lion lean to the side, as it looks unrealistic.
    2. When the lion goes down the hill, ideally the legs would stay more or less angled such that they are pointed straight up and down from the viewers perspective (within reason).

    I know things are more set up for a humanoid, but just wondering how I could achieve these goals. Thank you for all your help you have given me!

    Here's what it looks like right now, if I turn on "Orient to Ground". The top pane is the Game view, where you can see the lean to the right, since the slope is higher to the left:
    upload_2018-8-28_18-12-10.png
     
  45. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    Because the MC has a center "root" position, it wouldn't really allow the body to fall.

    I was trying to find some images of what a 4-legged animal would look like on a slope and this is the best I could find:


    In this case, the body does pitch. I'm assuming that the individual legs would bend to account for un-even terrain.

    If you wanted something more real, you could 'sink' the character based on the terrain. What I mean by that is if the body of the lion was nested in a GameObject, you could lower the lion based on the slope of the ground. That would cause 2 of its legs to bend while the other two would be more stretched out.

    However, on the steep terrain like you show in your images it may still be odd. I'd love to see a real-life image of an animal standing on 45-degrees like in your bottom left image. That might help us.
     
    TeagansDad likes this.
  46. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    124
    Haha, I did the same thing, trying to find a photo of an animal going downhill. Just did some more searching and found this:


    Plus this academic paper on the subject: https://academic.oup.com/icb/article/54/6/1159/636559

    The paper I think mentions animals lowering their center of gravity and moving more slowly as well, which matches what the wolf is doing. Also, the weight is supported on the back legs, while the front legs mainly act as "brakes". Going back and reading your post again, I think this is exactly what you were proposing with lowering the body.
     
    rubble1 likes this.
  47. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055
    That's pretty cool. It goes with what I was saying above where you could sink/lower the body and force IK to bend the legs.Just do it with 'Orient' on.
     
    hoodoo likes this.
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,055


    Before updating, PLEASE READ THIS!

    This update REQUIRES that you delete your 'Assets\ootii' folder and re-import the assets.

    Today I'm pushing up a massive update to all my assets. The primary goal is to support Unity's Assembly Definition Files, but there's some other cools stuff as well:

    1. Assembly Definition File support
    2. New character wizard (for the Motion Controller)
    3. Restructure folders so demo files are in one place (easy to remove)
    4. Smaller download size

    Please back-up your project and wait for all my assets (that you own) to be updated by Unity. :)

    As always, I'm here to help.
     
    hopeful and TeagansDad like this.
  49. AgathaCrup

    AgathaCrup

    Joined:
    Jun 20, 2013
    Posts:
    21
    Hey Ootii, I'm going to be buying a number of your assets when I'm back at my desk in the morning. Having reviewed them today...I wish I'd found them earlier. Couple of points, I've watched your impresive turorials and not had the time to scan this thread, I assume setting up an 'eye look' is as simple as adding the eyes somehow in the hirearcy of your bone system, if not is it possible?
    I'm really impressed with your content would you be working on any AI solutions by any chance? what about bundles...I'm gonna need all your products. Warmest.
     
  50. samuelbrunner

    samuelbrunner

    Joined:
    Jan 29, 2017
    Posts:
    31
    Hi, i followed the Quick starter guide, it seem i need to add some range to the effect

    Edit: omg i just bought this asset to have my foots following the terrain, i have interesst about the Sink stuff, i will rise it and lower it with some code


    Update: i had to change the foot toe distance to make it work


    This asset seem to work with ramp
    https://assetstore.unity.com/packages/tools/animation/mec-foot-placer-36961

    Also the Bone Controller destroy the walk animation, but im sure there is a way to solve it
     
    Last edited: Dec 7, 2018