Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Tail Animator - Procedural tail animation for tentacles, simple capes, squids and more!

Discussion in 'Assets and Asset Store' started by FimpossibleGames, Jul 18, 2018.

  1. Elfinnik159

    Elfinnik159

    Joined:
    Feb 24, 2013
    Posts:
    84
    Hello.
    I want to use TailAnimator to simulate a cloth. I was able to achieve this with DynamicBones, but it consumes too many resources. Can I achieve the same effect with TailAnimator ?
    I have a dress with bones. Each bone looks in its direction from the center.
    I need:
    1. To make bones react to specific colliders (4 capsules)
    2. Restrict bone rotation only on one local axis.
    I have not found how to limit the rotation. Is it possible?
     
  2. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    There is no option to limit rotations, but maybe I can add this feature, but could you mail to me your model?
    Then I will try to program everything to make it work fully in your case.
     
  3. Elfinnik159

    Elfinnik159

    Joined:
    Feb 24, 2013
    Posts:
    84
    In fact, I am still experimenting with this, and the model is rather coarse. I sent you a private message.
     
  4. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    200
    Bought all(3) of your packages. Just great.
     
    FimpossibleGames likes this.
  5. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Thank you very much for support :)
    Hope all of them will help improve visuals in your projects.
    Feel free to mail me if you will need some help with them.
     
  6. Lewnatic

    Lewnatic

    Joined:
    Sep 29, 2012
    Posts:
    200
    You did an awesome job. :>
     
    FimpossibleGames likes this.
  7. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    82
    Hi - purchased this today out of curiosity. We can't find any info/turtorials on doing this for 2d sprites (we use 2d toolkit). We've been playing around but can't seem to get the orientations right and the bones seem to be ignored. Can you help or point us in the right direction? A 2D sprite demo would be great thanks.
     
  8. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Hello, I just don't have right assets for 2D tails and my experience in 2D inside unity is poor.
    If you don't mind you can mail me one of your asset you want to animate with Tail Animator and I will check what to do to make it work correct. Unfortunately today I will not have time for this, but I will do my best to check it tomorrow.
     
  9. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    82
    Yes of course. thanks.

    BTW there are lots of free sprite assets available that you can use to test with in Unity's Standard 2D assets package.
     
    Last edited: Apr 17, 2019
  10. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    There is some free 2D characters assets on the Asset Store but there aren't ones designed with tail etc.
    No assets which would help with my purpose.
     
    SaltwaterAssemnly likes this.
  11. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    82
    OK, we managed to get it working. No idea why it wasn't working before! (Maybe not enough coffee?)
    Quick question - how can we access APIs? There's nothing in the docs. We'd like to be able to change rotation, speed etc via code. Thanks.
     
  12. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Great, there's nothing inside docs because variables visible in the inspector have the same or almost the same names inside class, so you do it in the same way like you do with your scripts.
    Just get reference to TailAnimator then go with tailAnimator.RotationSpeed = ...
     
    SaltwaterAssemnly likes this.
  13. akuei2

    akuei2

    Joined:
    Oct 17, 2018
    Posts:
    68


    Just purchase & playing around few day ago, here a demo.
    Amazing works for odd bug & weird creature. o_O
     
  14. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    46
    Hi! Wonderful asset. Just a real gem (as are the others as well!) Thank you very much for creating it.
    I do however have a bit of an issue though and was hoping someone might have an idea. When my character makes a hard turn, its like the tail twists around 360 degrees. Is there a way to clamp that maybe? would be really nice to have some control over the rotation some like the LookAt asset does. Thanks! :D
     
  15. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Thank You!
    Not sure what motion you mean by hard turn, maybe use blending variable when turning occurs, or crank up "Positions" / "Rotations" Speed variables for a moment?
     
  16. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    46
    ah k. thanks, I'll give it a shot.
     
  17. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    46
    Nice...got it. Seems I had my root bone set a bit too far up the spine. Thanks for getting back so quickly!
     
    hopeful likes this.
  18. plabermeier

    plabermeier

    Joined:
    May 17, 2017
    Posts:
    2
    just starting out here... Is there a setting to synchronize the waving tentacles?
     
  19. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    True intentions are to make them all wave differently, but if you need all to wave the same, you can change Init() mehod inside FTailAnimator.cs to this:

    Code (CSharp):
    1.         protected override void Init()
    2.         {
    3.             base.Init();
    4.  
    5.             waveTime = 0f;
    6.             cosTime = 0f;
    7.         }
    If you need this only to selective tentacles, you could do something like this:

    Code (CSharp):
    1.         public bool NoRandomTime = false;
    2.  
    3.         protected override void Init()
    4.         {
    5.             base.Init();
    6.  
    7.             if (NoRandomTime)
    8.             {
    9.                 waveTime = 0f;
    10.                 cosTime = 0f;
    11.             }
    12.             else
    13.             {
    14.                 waveTime = Random.Range(-Mathf.PI, Mathf.PI) * 100f;
    15.                 cosTime = Random.Range(-Mathf.PI, Mathf.PI);
    16.             }
    17.         }
    Then toggle variable "NoRandomTime" inside inspector after clicking "default inspector" (only here it will be visible, it will appear on the bottom of component's inspector window)
     
  20. plabermeier

    plabermeier

    Joined:
    May 17, 2017
    Posts:
    2
    Thank you for the help and quick reply. Works great as I am modeling brain ventricle cilia which move in unison.
     
  21. Dobalina

    Dobalina

    Joined:
    Sep 6, 2013
    Posts:
    46
    @FimpossibleGames
    I'm seeing tails drift away. I'm wondering if anyone has encountered this issue before. I copied a tail from the demo and paste it into my scene. When I hit play, the tail starts to drift away from the parent location.
    - It snaps back if I 'Root to parent'
    - If I set the update ordered to 'Fixed' you can see it quickly drifts off.
    I have no idea why this is happening in my level, but doesn't happen in the demo scene. Does anyone have any suggestions? drifting_tail.gif

    Found out if I used the 'tail_animator blending' script , it doesn't have this drifting issue. But the regular tail_animator script still has this problem.
     
    Last edited: Aug 5, 2019
  22. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    558
    *If you are not interested in discussing grass please let me know and I'll move the topic.
    How goes the update to the grass?
    It looks like you have started messing with hair.
    For the grass I would expect them to be quite thick for performance reasons but even then you could provide an optimization so that you choose a master bone in every patch of grass and all the other grass will follow that grass rotation which should help performance since they all move in sync now?

    Here is a video example of someone implementing this sort of:


    That clip is from this asset:
    https://assetstore.unity.com/packages/vfx/shaders/shader-pack-01-cartoon-landscape-147422

    Hmm actually this gives me an idea-what if we could use your asset as a sort of leaves generator for shrub so instead of a thousand pieces of individual grass we can make a big peice of shrub and have it animate and stuff:



    Even if we try an entirely different formula to covering the whole field with small grass there has to be a way to do it because I see things like this:


    That's from Landscape Auto Material
     
    Last edited: Aug 8, 2019
  23. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    46
    Just thought I'd share a video of this creature from my game. It's one of the more primitive videos from a few months ago right after I got her running, but it's probably one of the better clips in my pile file for showing off the Tail Animator. Thanks so much for creating this @FimpossibleGames! It really does do the job in a most elegant way. :)

     
  24. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    It seems algorithm for grass must be simplier and cheaper in calculating, we talk about giant numbers of grass blades to be animated, then algorithm must work in less continous way, like tail animator does, but with more time I will do more experiments.

    Thanks ProtoPottyGames! That's cool you decided to share video ;)
     
    ProtoPottyGames likes this.
  25. Bahamoot

    Bahamoot

    Joined:
    Aug 14, 2019
    Posts:
    3
    Hey! A big question, me and my team are interested in getting this asset, we just wanted to know if your supported collisions included all types of colliders (sphere, cube, convex, mesh, etc) being able to affect the simulation at runtime, this is something other assets can't do
    We just want our tail to interact with the world, not just a single sphere
     
  26. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Hi, collision feature of tail animator is now on early stage, it is interacting with all colliders from world, but it's not as precise as you probably want it to. For now it offsets single tail segments to avoid models clipping.

    It works with world colliders, with terrains too, as you can see, sometimes it works pretty well but sometimes it can still clip (you can crank up tail's generated colliders size but then collision radius is big but safe, like this one tail nearest to camera):

     
    Last edited: Aug 14, 2019
    ProtoPottyGames likes this.
  27. zagreekie

    zagreekie

    Joined:
    Nov 20, 2017
    Posts:
    13
    Awsome asset! we are using it for everything, in our sci-fi horror game, however, I was wondering is it possible to have an option to slow down the simulation as a whole? in this situation, I am using your asset to simulate creepy floating wires in a zeroG spaceship internals. however the swaying is to fast, but when I turn down the speeds it seems to make the tail bend far too much, making strong S curve like shapes, I would like it to animate more or less the way it is now but at an overall much slower speed.

    share.getcloudapp.com/xQu9Yg29
     
    Last edited: Aug 14, 2019
  28. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Thanks! Cool to hear!
    I wasn't thinking about such feature as slowing down whole motion, it can be hard to achieve with this algorithm logics, but I will try to find way to do it effectively.

    Cool graphics! If you want tail to bend a bit more smoothly, you can try adjusting weights on bones to be more spread, depends from modelling software you're using, there can be something named as "Weight Smoothing"
    then set variable "Quality" in SkinnedMeshRenderer to "4 Bones" (it's also in quality settings) or check how other options affects result. Also you can use more bones for more smooth effect.
     
  29. zagreekie

    zagreekie

    Joined:
    Nov 20, 2017
    Posts:
    13
    Thanks!

    I will experiment with your ideas, Maybe it's not necessary for a full slowing down of the simulation, but if you could add any feature that achieves similar results, so it can look a bit more like the cable is naturally drifting (in a kind of creepy way) in zeroG it would be awesome. ill keep you posted on how the development goes, we use your tail system for everything, including all the enemies.

     
    FimpossibleGames and chelnok like this.
  30. Bahamoot

    Bahamoot

    Joined:
    Aug 14, 2019
    Posts:
    3
    Hi again! I bought the asset because I liked the demo you showed me, but after trying in different unity versions I can't replicate the collisions from your gif, or make the scene that shows the collision feature work properly (as shown in your videos)
    Is there another step I'm missing here? are you using a specific Unity Version?
    The follow through effect it gives is amazing!
     
  31. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    I just opened S_TailAnimator_DEMO_Collisions scene and used tails from there (no changes in the components) each one have slightly different collision setup which you can follow how it behaves, collision stuff is under last tab inside inspector view of component (during playmode some options are hidden because they shouldn't be changed in the runtime)
     
  32. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Updated to version 1.3.0:

    - SmoothDelta changed and upgraded to SafeDelta to support more smoothed motion when fps are very unstable
    - Added option "Selective Rotations Not Animated" if some bones in tail chain don't have rotation keyframes in source animation (I noticed that some free models on the asset store can benefit with this)

    - 'Rolled Bones' replaced with field where we can select LookUp algorithm, added 'CrossUp' algorithm which can support tail motion more precisely than previous methods (when your tail is curved in t-pose for example) and 'Parental' which seems to be the most universal but giving a bit different motion (then crank down positions and rotations speeds variables)

    - Added 'MaxPositionOffset' variable to limit stretching of tail when object moves very fast
    - Added 'Fuman Elasticness' example scene
    - Added 'Curving' and changed logics of 'Gravity' variable in "Experimental" tab
    - Some upgrades in the inspector window


    Soon there will be more tutorials to enchance animations with tail/spine/look animator with the newest updates.
    https://assetstore.unity.com/packages/tools/animation/tail-animator-121819
     
    Last edited: Sep 17, 2019
    ProtoPottyGames likes this.
  33. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    I've just submitted version 1.3.5 for review (will be available in about 5 days)
    which will bring new parameters for tail motion giving much more possibilities and also will bring more precise collision detection in world space and new option to detect collision only on selected colliders (faster and more precise)

     
    ProtoPottyGames likes this.
  34. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Updated to version 1.3.5:

    - Added "Sensitivity" variable to give much more animation customization possibilities for tail motion, this variable making tail being more stiff (when lower) or entangled (when higher)
    - Added "Springiness" variable to give much more animation customization possibilities for tail motion, this variable gives tail more jiggly motion when cranked up
    - "MaxPositionOffset" variable replaced with "Max Stretching" which is 0-1 slider, on value 1 tail can stretch freely, on value 0 can't stretch a bit, setting this value to about 0.15 is giving the most natural feeling to the motion

    - Better support for single bone tail chains (root to parent toggle)
    - Cleaning code resulting in few optimization, preparations before next versions optimizations

    - New approach to collisions, now there are three different methods of detecting collisions to choose (only in world space), old one is called "Rotation Offset" (needs bigger sphere tail colliders but works better in collision with mesh colliders), different methods can work better depending on situation etc.
    - Now you can choose to use world collision detection (collision space variable) or just include needed colliders without use of rigidbodies (quicker)
    - "Collision Swapping" (under Physics Tab) which is making collisions being less reflective in segment rotation (will be polished in next updates)

    - Added new demo scene "S_TailAnimator_Demo_CollisionWall"
    - Added info inside "ReadMe.txt" which directories you can remove to purge unnecessary files if you don't need demo scenes anyomore
    - Some cleaning and changes inside inspector window for quicker navigation



    > Asset Store Link <
    Detailed update video and new tutorials soon
     
    ProtoPottyGames and hopeful like this.
  35. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    334
    @FimpossibleGames Wanted to stop in and thank you for the great assets, as in our latest project Jurassic Extiction, they have helped greatly. All dinos have tail animator on them (looking very realistic, can be tweaked a bit), next up is Spine Animator to all dinos. Heres a progress vid to show what ive done with Tail Animator (mind you, this is in Dev mode, no fog or etc.):

     
    FimpossibleGames likes this.
  36. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    46
    Hey thanks for the recent updates. Very much appreciated. :)
     
  37. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    314
    hello, I have a problem with my tail, all of the bones bend like this, is that a problem with the rigging/skinning?

     
  38. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Hey skinwalker, you can check Tuning tab and toggle "Full Correction" (you can do it during playmode)
    if it doesn't help you can try changing "Look up method" to 'Parental' or 'Rolled Bones' (full correction must be enabled)
    Let me know how it goes ;)

    It is caused because of rotated bones orientations but it is common problem, each modelling software have it own rules which axis is up which is forward etc. but tuning parameters can help you fix it without need to change anything inside your model.
     
    Last edited: Oct 8, 2019
  39. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    314

    Full correction - Parential seems to be giving the best result, is there a way to slightly push it back because now while my character is walking the tail is clipping through his legs during the animation

    Edit: Setting waving axis to 0,0,0 and then tail rotation offset to 20,0,0 seems to be fixing it and pushing the tail up. Let me know if there is a better way to do it, but Im happy with the result so far :)
     
  40. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    One method: You can assign capsule colliders to leg bones, then disable capsule colliders (so they not colliding with world) then enable collision in TailAnimator inside tab on the bottom, set collision space -> selective then put here your capsule colliders (disabled colliders are detected, but if their whole game object is disabled they're not).

    Other method: Use 'Tail Rotation Offset' under 'Waving' tab to adjust rotation of tail, or animate this value from code when character is moving. Also you can make tail more stiff with "Sensitivity" variable, crank it down to value 0.25 for example.

    I think I will also make example script for rotating tail back when it reach certain angle limit, but don't know when I will have enough time for programming that.
     
    Last edited: Oct 8, 2019
    skinwalker likes this.
  41. moondust-games

    moondust-games

    Joined:
    Jul 21, 2013
    Posts:
    24
    Hello. What's mobile performance like with this asset? Say 10 tentacles animated in a scene?
     
  42. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    I made tests on two different smartphones with android.
    I created project with unity 2019, lightweight render pipeline, instantiated tentacles with unlit shader and there are results:

    With enabled renderers on tail meshes (rendering so many meshes sometimes can take more time than algorithm's work):

    Tested on above 2 years old MyPhone Hammer Energy, Android 7.0
    ~45 - 50 fps with 120 tails, each having 8 animated bones

    Tested on not so old Samsung Galaxy a20e
    Stable 60 fps with 120 tails, each having 8 animated bones
    ~40 - 45 fps with 240 tails, each having 8 animated bones

    With renderers disabled (raw algorithm's job):

    Tested on above 2 years old Hammer Energy, Android 7.0
    Stable 60 fps with 70 tails, each having 8 animated bones
    ~50 - 52 fps with 120 tails, each having 8 animated bones

    Tested on not so old Samsung Galaxy a20e
    ~35 - 36 fps with 360 tails, each having 8 animated bones


    Notice if you need very smooth tentacles, you should set inside used quality settings "Skin Weights" to 4 bones.
     
    Last edited: Oct 27, 2019
  43. moondust-games

    moondust-games

    Joined:
    Jul 21, 2013
    Posts:
    24
    Thanks for the information.
     
  44. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    Updated to version 1.3.6:
    - Added "Max Angle" variable to limit maximum rotation of each segment from it's initial rotation (position and rotation speed parameters have influence on this parameter in this version, lower values - clamping react slower)
    - Using "Max Angle" parameter, enables other parameters to limit selective axis of rotating, otherwise all axes are clamped to "Max Angle"
    - Added parameter "Stiff Tail End" in "Experimental" tab which is making last tail segments more stiff for some extra tweak for tail motion
    - Upgraded behavior of "Gravity" parameter
    - Added new example scene and models for testing behavior of Tail Animator for hair
    - There was bug which made "Rotation Speed" parameter change nothing in tail motion, fixed
     
  45. FimpossibleGames

    FimpossibleGames

    Joined:
    Jun 27, 2018
    Posts:
    159
    New manual video explaining all essential parameters of tail animator:
     
    ProtoPottyGames likes this.