Search Unity

Ultimate Rope Editor - New powerful rope physics for Unity3D [RELEASED]

Discussion in 'Assets and Asset Store' started by UGTools, Feb 11, 2013.

  1. MeTheOo

    MeTheOo

    Joined:
    Dec 14, 2014
    Posts:
    17
    Is it possible to limit the distance you can drag the rope based on total length, so that it won't go haywire.
     
  2. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi daville!

    Sorry for such a late reply, usually I receive a mail notification but it seems I didn't see yours.
    Start must need to be static, so either you use a node without a rigidbody or you use a rigidbody with kinematic checked.
    End needs to be dynamic so you need to use a node with a rigidbody and without kinematic checked.

    Then after that the rest is just finetuning. If you want the rope to be locked in the z plane, then you can just select all links the rope editor has generated and lock them in z using the constraints panel on the rigidbody. You need to check the Z of Freeze Position.

    I can help you with further parameter configurations if you need it :)

     
  3. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Definitely not! I will check this and provide a fix ASAP :)

     
  4. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    How do you drag the rope? is one end static and the other end dynamic? are you applying forces or are you moving them directly setting positions?

     
  5. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    272

    Hi thanks for answer, this reply was late but, you did answer quickly when I sent you an email back then :) so no problem thanks.
     
  6. Narendraom

    Narendraom

    Joined:
    Jul 8, 2015
    Posts:
    34
    Hi UGTools,

    I want to make a "knot" simulation, which it includes "self-collisions", and a user can make it fixed when the two ends of a knot are pulling tightly. Has your Ultimate Rope have these functions? If not, How can i make tie. Please suggest me how can i achieve this. Thanks in advance.
     
  7. MeTheOo

    MeTheOo

    Joined:
    Dec 14, 2014
    Posts:
    17
    Start is static and end is dynamic
    By force. and it happens if the force is too strong.
    Please see the video for demonstration:

    In the video, I simply dragged the object in editor to force the object move outside of the rope length. It behaves the same when I apply the force in game.

    Thanks so much!
     
  8. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I think with the current physics system in Unity (PhysX by nVIDIA) it would be very difficult to achieve a stable result .You would need a custom physics solution I'm afraid :(

     
  9. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi there!

    You simply can't drag a rope beyond its length, you would need to use an extensible rope for that, and extend the rope to at least the same distance as the dynamic end.

     
  10. MeTheOo

    MeTheOo

    Joined:
    Dec 14, 2014
    Posts:
    17
    Thanks for the reply!

    What if the rope is controlled by force?
    See this video:


    Where I swing the rod too fast to cause the rope goes crazy, because the force applied is too strong.
    I assumed that if the rope is not breakable, it should keep the same length.

    Thanks so much for your kindly help!
     
  11. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    725
    @UGTools Hi, I just upgraded to Unity 5.3.0f4 and I get multiple warnings related to the rope system whenever I save a script:



    In case this isn't fixed yet, could you please have a look at those? Thanks!
     
  12. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi Seith,

    Sure! I'll get rid of those annoying warnings ASAP :)

     
    red2blue and Seith like this.
  13. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,045
    I'm setting up a grappling hook, and your rope works great with it -- until I enable colliders on it. Then it goes crazy at runtime, bouncing everywhere. I assume that's a problem with the link colliders reacting against each other? Is it possible to set the collliders to react only to another layer(s) and not to themselves? Or is there another way to make this work? Here are my settings:
     

    Attached Files:

  14. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    725
    Hi! Do you know if the new version (that corrects the warnings) has been published? When I look in the asset store it still seems to be the same version...
     
  15. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    When will the update be published? These warnings have been there for a month now.
     
    Seith likes this.
  16. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    725
  17. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi guys!

    Yes, thanks for the heads up Seith, I wasn't getting notified :)
    I have uploaded the update and it should be available soon, sorry for the delay! I fixed the compiler warnings for all my assets but somehow forgot to make them publicly available.
    If you need them really quick just send me an e-mail and I'll send you the modifications right away.
     
  18. plyrek

    plyrek

    Joined:
    Mar 2, 2015
    Posts:
    15
    Hello, I am trying to simulate a medical device procedure. For that I need the rope to act more like a flexible piece of plastic or segmented thin metal wire. Could you suggest what the best settings for this would be. I at least have to eliminate much of the sway and bounce at the end of the rope.

    Thank you for your help!
     
  19. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi plyrek,

    Try setting Link Joint Spring and Link Joint Max Force to higher values (10, 100, 1000...), that should make it a little more rigid.
     
  20. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,045
    hey @UGTools , any tips on my question above about grappling hooks?
     
    davidkrings likes this.
  21. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hey gecko,

    Sorry! I missed that one :)
    Usually the rope doesn't have self-collision problems because neighbor links don't collide with each other, only every 2 colliders which is normally enough to avoid those situations. Maybe it is the hook itself that is attached to the rope and is intersecting it all the time?
    If so you can assign the rope and the hook different collision layers and disabling collisions between them in Edit->Project Settings->Physics.
    You can also try to assign the rope a specific layer using the Rope Editor inspector panel and disable self collisions on the same physics settings to make sure it isn't the rope itself.
     
    davidkrings likes this.
  22. davidkrings

    davidkrings

    Joined:
    Feb 15, 2016
    Posts:
    12
    That did the trick for me! Thanks!
     
  23. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,045
    Thanks for the suggestions, but still having trouble. Grappling Hook is on a separate physics layer from Grappling Rope, with physics disabled between them, but the rope is still pretty crazy. I think that Grappling Hook was on your list of upcoming features; did you ever make a sample that we could try?
     

    Attached Files:

    davidkrings likes this.
  24. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    Hi there!

    I have a slingshot weapon/tool that requires the simulation of the elastic (surgical tubing?) part. Would "Ultimate Rope Editor" be a good solution for me?

    Thank you in advance!
     
  25. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Hi, how do I create a rope in runtime?
    I tried it with this code but I get a null reference exception.. Did I forget something?

    Code (CSharp):
    1.  startNode = new GameObject();
    2.             startNode.transform.position = new Vector3(transform.position.x, transform.position.y + 5, transform.position.z);
    3.             rope = gameObject.AddComponent<UltimateRope>();
    4.             //Set rope parameters
    5.             rope.RopeLayer = LayerMask.NameToLayer("Rope");
    6.             rope.RopeType = UltimateRope.ERopeType.Procedural;
    7.             rope.RopeStart = startNode;
    8.             rope.RopeDiameter = 0.07f;
    9.             rope.RopeSegmentSides = 8;
    10.             rope.RopeMaterial = ropeMaterial;
    11.             rope.RopeSectionMaterial = ropeMaterial;
    12.  
    13.             //Null reference exception: RopeNodes = null
    14.             for (int j = 0; j < rope.RopeNodes.Count; j++)
    15.             {
    16.                 rope.RopeNodes[j].fLength = 7.15f;
    17.                 rope.RopeNodes[j].nNumLinks = 17;
    18.                 rope.RopeNodes[j].eColliderType = UltimateRope.EColliderType.Capsule;
    19.                 rope.RopeNodes[j].nColliderSkip = 0;
    20.                 rope.RopeNodes[j].goNode = gameObject;
    21.                 for (int i = 0; i < rope.RopeNodes[j].linkJoints.Length; i++)
    22.                     rope.RopeNodes[j].linkJoints[i].breakForce = 3.402823e+38f;
    23.             }
    24.             rope.Regenerate();
     
  26. DotTeam

    DotTeam

    Joined:
    Feb 12, 2016
    Posts:
    130
    Ropes with physics are cool. :) Yours looks great.
     
  27. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi BYD!

    You seem to doing almost everything fine! Just initialize the RopeNodes list before the for:

    Code (csharp):
    1.  
    2. rope.RopeNodes = new List<UltimateRope.RopeNode>();
    3. rope.RopeNodes.Add(new UltimateRope.RopeNode());
    4.  
     
  28. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Thank you, it worked. :)
     
  29. Kazy

    Kazy

    Joined:
    Aug 5, 2015
    Posts:
    2
    I'm having a lot of trouble with this. I want to have a phone cord on a phone that can be picked up with a Leap Motion, but the physics of the rope are acting very weird. It feels like the rope itself is "pulling" on the phone too much. Any tips on what settings make a good simple rope/wire? I've got a couple of invisible spheres acting as segments since the phone is connected to the hook under it.

    http://i.imgur.com/6Msg0pn.png
     
  30. keeperkai2

    keeperkai2

    Joined:
    Oct 26, 2012
    Posts:
    14
    I have been trying to implement my own ropes but a few problems pop up, I would like to know if this rope editor has the same problems, if not then maybe I'll buy it. First of all, I require ropes to be pulled by the player character around a scene with mesh colliders, the player can pick the rope up any time he wants:
    1.Physics simulation cost: my ropes with about 50 segments each, and 30 ropes that react with the scene will make the fps of my game go down to around 100(without anything that takes up a lot of cpu time)
    2.Physics simulation accuracy: sometimes the ropes goes through mesh colliders because one segment of the rope somehow went through the collider, it doesn't happen often but it happens, will this happen with this extesion?
     
  31. The_Domaginarium

    The_Domaginarium

    Joined:
    Dec 11, 2012
    Posts:
    20
    Hi, I don't know if this has been answered or if I missed it (I only saw a post with a video). Is there a way to connect multiple ropes to an object? For example, I have a plank and I'd like to connect 2 ropes to it, and at some point break one of the ropes so the object "swings" due to gravity.

    Thanks
     
  32. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes. You should create a plank and place 2 empty gameobjects where the connections should be. Add rigidbodies to all 3 objects and create 2 fixed joints between the plank and each connection. Now you can create 2 ropes setting the connections as Rope End.
    That should do the job :)
     
  33. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Problem 1 is due to the fact that physics computations are very expensive and computed on the CPU. Problem 2 is because Unity's physics aren't accurate enough to always avoid those situations.
    The Rope Editor uses the same primitives you probably have used (multiple rigidbodies linked through joints) and Unity's own physics system (PhysX by nVIDIA) so there is not much more you can do to avoid both situations I'm afraid.
     
  34. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi Kazy!
    Do those spheres have physics as well? From the screenshot I can see the rope seems like 3 straight tubes instead of a nice looking cable :)
     
  35. Ewakhine

    Ewakhine

    Joined:
    Apr 11, 2016
    Posts:
    5
    Hi UGTools,
    Your asset is very useful, thanks.

    I want create realistic electricity cable with no spring bounces. This cable need to be extensible to suggest high voltage. For this I use these parameters :

    CableParameters.png

    For initialization I try to drawn tight with use minimum numbers of links but I have always some little bounces. Have you an advice to stop those bounces ?
     
  36. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi there!

    Sorry for the late reply, I wasn't getting any notifications and just saw this going through my forum threads :)
    If you are annoyed by bounces at the start, you can try to press play so the ropes are simulated, and when they are still check the "persist after playmode" option. Then press stop, and now the resting state of the rope should be saved.
    Don't forget to uncheck the "persist after playmode" again so it isn't saved again after each Play.

    For stiffer ropes, increase both Link Joint Spring and Link Joint Max Force to higher values. Set them both to the same value and don't be afraid to use very high numbers if needed :)

     
  37. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    126
    Hi,

    I am trying to optimize the use of this amazing tool. My approach is to make the Rope rigidbodies sleep/awke or isKinematic on off.
    Could you please tell me which is the method used in your code to make "Reset Rope" ?
    I use Playmaker and I would be lauch it each time I activate the Rope.

    Thanks in advance,
     
  38. BerlinSiege

    BerlinSiege

    Joined:
    Jan 2, 2016
    Posts:
    4
    Hi Guys,
    We bought your asset - looks good sofar and works well!

    Need help with three things:

    Extensible coil rope demo:

    o Yellow wheel for coil demo is missing - please provide or are we missing something?
    o The coil demo shows a stiff rope section - how do we adjust the length of the stiff part ?
    o The rope doesn't hang straight down past the quad it runs over, but there is more of a curve for a foot or two - how can we adjust the setting so the rope creates a sharp curve?

    Thanks in advance!
     
  39. BerlinSiege

    BerlinSiege

    Joined:
    Jan 2, 2016
    Posts:
    4
    Hi UGT - any reply?

    -Berlin
     
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,041
    You should tag the dev by typing @UGTools or send a PM or an email if you want to increase your odds of a timely response. The forums don't always notify a thread owner when a new post is made.
     
  41. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi BerlienSiege!

    I think at some point I removed the mesh from the project, I will send it to you and add it to the next version.
    PM me an e-mail :)

    The stiff part is the distance between the Coil object and the Rope Start. You can move either one of the two

    I will check this out. I think right now it exits using a vector pointed by (RopeStart - RopeCoil) but I may change it so that it points using the RopeStart transform. This way you could edit the exit vector :)
     
  42. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It is called Regenerate(). Use rope.Regenerate(false).
     
  43. Ewakhine

    Ewakhine

    Joined:
    Apr 11, 2016
    Posts:
    5
    Hi @UGTools,

    Thanks for your reply, I base my parameters with your advice and it works.
    Now I try to skip initialization with procedural two-extremity points rope. Is it possible ? I try two ways.

    First : make a rope with lots of links.
    Result isn’t conclusive. The rope have a little curve and for the physics in playmode I think it isn’t the best way.

    Second : make a rope and play with my initialization’s parameters with check « persists after playmode »
    Initialization’s result is fine but when I try to change extensibleLength in editor, after uncheck « persists after playmode », my rope is reinitialize and become a straight line. So with no curve in initialization.
    And I try to change extensibleLength in code in a StartFunction, my rope don’t add extensible links and I don’t understand why. I check my extensible method and my parameters and they change with no problem but I haven’t visuel change.

    Have you an advice to have a procedural rope with just two points what can have a curve in initialization and can be extensible ?

    EDIT : I have a acceptable result if I check "persists after playmode" and set extensibleLength to my maximum value. I need to save my initialExtensibleValue so I block in this position my rope then I quit playmode. I uncheck "persists after playmode" and it's done. I don't sure that the correct way to made this but it works.
     
    Last edited: May 12, 2016
  44. DotBow

    DotBow

    Joined:
    May 12, 2016
    Posts:
    1
    Greetings! Demonstration on video is really exciting and I think about buying this tool. But I have some questions.
    My project is specific and need realistic rope simulation. There is in video a coil simulation, but coil and rope are meshes, as I can see. Is it posible to simulate a reel up to coil with no prepared mesh, like in real life? Also, can I make rope more elastic and strech it like electric wires?
    Sorry for my bad english, hope you understand me:)
     
  45. guidoponzini

    guidoponzini

    Joined:
    Oct 4, 2015
    Posts:
    55
    I'm facing a problem: there is a way to have a ball at the end of the rope and with drag/touch option I can move it and the rope follow the movements closely? As even if I put "Is extensible" with a long number, at a certain point the ball seem to detach from the end of the rope and everything goes mad... Solutions?
     
  46. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    We're running into severe memory problems with this asset and are curious if anyone else is seeing the same thing.

    Our game spawns 14 procedural ropes at startup, and the player can create more at runtime. But even before the player starts creating them, there are terrible memory allocations with the initial 14 ropes.

    Profiling in a standalone build, UltimateRope.FixedUpdate() is showing 1.3MB of allocations per frame, which causes a garbage collect about once per second. This causes huge framerate spikes, from 60fps down to 15fps for that frame.

    Using the deep profiler in the editor, the culprit seems to be Mesh.GetTriangles(), which allocates two new int arrays every FixedUpdate().

    Is anyone else seeing bad memory problems with procedural ropes?

    @UGTools, is this expected behavior? Is there any way around it?
     
  47. mvandillen

    mvandillen

    Joined:
    May 15, 2016
    Posts:
    5
    When I copy the rope from demo1 scene into my own scene it immediately explodes on startup, ie all segments spring into the air and fall to the ground. What could be causing this? I'm trying to get a rope working but only the demo scenes seem to work. Please advice, thanks!
     
  48. Frogger007

    Frogger007

    Joined:
    Jun 24, 2014
    Posts:
    338
    Is there no video tutorial for this rope asset ?
     
  49. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    If everything goes haywire then probably you are extending the rope more than the actual length of it. You should check if the distance between start and end is larger than the rope length, and if it is, prevent the ball from moving further if you are moving it manually.
     
  50. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I think I found it, you are right, mesh.GetTriangles() creates a copy and that's the reason why it creates so many memory allocations. I will make a fix ASAP, please send me an e-mail to test it to info@ultimategametools.com :)
     
unityunity