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. HsinChien

    HsinChien

    Joined:
    Nov 19, 2012
    Posts:
    22
    Hi!
    I have a question: I want to make a puppet with a lot of strings attached to it, and I need the strings that do not tangle with each other (or no collision between ropes). Is this possible with your plugin? Thanks!

    Hsin-Chien
     
  2. UGTools

    UGTools

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

    Yes you can. You just need to assign each rope a different layer and then using the physics manager (http://docs.unity3d.com/Documentation/Components/class-PhysicsManager.html) use the collision filtering options to disable interactions between each rope.

    Hope that helps!

     
  3. HsinChien

    HsinChien

    Joined:
    Nov 19, 2012
    Posts:
    22
  4. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    Sorry if this has been answered already. Is it possible to create a rope in script at runtime? I create a rope prefab and try to set the start point and get an exception that the start point isn't set.
     
  5. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi kenlem, can you paste here the exact lines of code you are using? Thanks!
     
  6. black-io

    black-io

    Joined:
    Apr 10, 2014
    Posts:
    4
    Can I make the rope sticky? Lets say it can stick on wall and stick to each other like the spiderman silk dynamically?
     
  7. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi black-io,

    I would do that using fixed joints created dynamically at runtime, you can "fix" the end of the rope to the wall or any other object and then use it to swing.

     
  8. AntLewis

    AntLewis

    Joined:
    Feb 2, 2010
    Posts:
    254
    Hey, just bought the package - amazing stuff. Is there anyway that the rope can work in 2D (so with Rigidbody2D)?
    Thanks!
     
  9. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Not at the moment, sorry. It only works with 3D primitives, so only 3D and 2.5D :)

     
  10. Dex7er

    Dex7er

    Joined:
    Jun 5, 2014
    Posts:
    7
    Hey, I just got your PlugIn from the Asset store today and was wondering if you could offer some hints to maybe save me what is going to undoubtedly take a lot of time to figure this out.

    What I basically want to do is have a long one-time animation of a crane picking up a piece of heavy machinery and setting it down somewhere else.

    For that purpose I have this crane setup:


    I want to first lower the hook down to the machinery with the 2x4 cables that are supposed to stay relatively stiff like this (could do with only 2x2 cables for the purpose of resource saving though maybe), but extend to the bottom, then have two actual ropes that will be attached from each side of the machine and hopefully show some physicality.

    I'm relatively new with Unity and my first problems were probably of my own making, with the crane being a sub-object of an imported warehouse, the rope kept attaching itself on the 0/0/0 corner of the warehouse.

    If I try to set up a start and end point at the upper end and the lower (yellow) part as a coil it seems to create a square instead:


    After that I tried creating a rope with a start point at the top left, end point at the top right and two mid points where the coil is with colliders and a rigid body:


    And I at least got the rope/cable to dangle:


    Anyway, any tips or hints on how to do this best would be appreciated, thanks. :p

    And if you've got some time at some point, you could maybe do a short guided YouTube Tutorial of the basic features and use-cases in your PlugIn and what everything does with visual aid, like the QuickRopes guy did for instance:


    I find them especially helpful, been using a lot of them to learn like this series: http://www.3dbuzz.com/training/view/unity-fundamentals
     
  11. geePrompt

    geePrompt

    Joined:
    Nov 6, 2013
    Posts:
    3
    How would I set up a rope between two objects that exerts no force on either object? I'd like the rope to bounce and respond to the objects as they move, but I don't want it to actually affect the motion/physics of either object.
     
  12. hww

    hww

    Joined:
    Nov 23, 2007
    Posts:
    58
    Hello,

    Is there any way to setup rope with a variety of link lengths? Look at image below. There is an array LinkLengths, and appropriately at the line 1426 it filled by data

    Code (CSharp):
    1. LinkLengths[nLinearLinkIndex] = node.fLength / node.nNumLinks;
    In fact the rest of code does not use data from this array, and I do not see way how to get required chain configuration.
     

    Attached Files:

    Last edited: Jul 12, 2014
  13. hww

    hww

    Joined:
    Nov 23, 2007
    Posts:
    58
    Last edited: Jul 14, 2014
  14. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi Dex7er!
    Sorry for the late reply! I sometimes have problems with the forum notifications, not sure what went wrong this time. If I don't answer immediately please send me a message to info@ultimategametools.com!

    Regarding your questions:

    The coil seems weird because you need to give it more bones, you will see it will start smoothing out when you increase the bone count.
    For your other questions, I think the best thing I can do is send you the crane sample scene so you can check out the parameters and setup I used. Send me an e-mail and I will send you the link back :)
     
  15. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    How do the other objects move? using physics? If not you can always assign them a rigidbody with the kinematic option checked. This way you can move both objects but the rope physics won't affet them.
     
  16. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    You can't with the current tool. How would you want to specify the link lengths?
    Also, do you want to use it to have more precision towards the hook? but still keep the total number of links low?
     
  17. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It seems the system is putting 2 links instead of one in that case. Can you send me that sample scene so I can take a deeper look at it? Thanks! :)

     
  18. hww

    hww

    Joined:
    Nov 23, 2007
    Posts:
    58
    Plan A: Use segments. The join between segments is not necessary connected to kinematic or another body. We have just one rope, two ends of connected to some bodies, but the rope from 2 segments, each has it's own precision.
    Plan B: Just add feature "Override the length of fist join to N"

    The reason for this make end of rope as much shorter when rope not expanded. And at same time it should not have too many joints when it is expanded.
     
  19. hww

    hww

    Joined:
    Nov 23, 2007
    Posts:
    58
    Your scene 05 - Rope extensable, switch to coil less, then make segment with 1 m long and 1 joint. Rebuild rope, look at result, now run game and see how it change.

    I want mention another thing. In case if you set segment 1m and 2joints. When you condense rope would be good if it can be 1 join length. Because now it will never be shorter that 2joints.
     
  20. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Hey,

    I'm prototyping a new Articulated Physics engine that will address some of the rope simulation concerns like ropes with heavy weights at the ends.

    Here is a demo video comparing the default PhysX engine's rope performance to the Articulated Physics engine:


    And this is the forum thread with more information included.
    http://forum.unity3d.com/threads/articulated-physics-engine.259889/

    I'm thinking to integrate it with Ultimate Rope Editor some day when I get time. Have fun!
     
    UGTools likes this.
  21. geePrompt

    geePrompt

    Joined:
    Nov 6, 2013
    Posts:
    3
    Thanks for the reply (and great asset!). I think I have the physics figured out, but a follow up question is: if I make the end point objects kinematic and then move them, the rope goes crazy for a second or two before settling down. Is there some way to just simulate a bunch of frames in the background so the user doesn't see this happening?
     
    UGTools likes this.
  22. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    You may use a spring joint to pull the end point in that case instead of using a kinematic object. Kinematic object is equivalent to physics object with infinite mass moved by infinitely huge force. It will cause stability of the default Unity physics engine. Articulate Physics engine I'm prototyping will work better in the case that end point of rope is pulled with tremendous force. See my video in the last post for example.
     
    UGTools likes this.
  23. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    The built-in PhysX engine doesn't seem to cut it. Created a 5 rope model like this simulated with Articulated Physics Engine.



    It's a WIP - http://forum.unity3d.com/threads/articulated-physics-engine.259889/
     
    UGTools likes this.
  24. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    181
    Hi

    I have just bought Ultimate Ropes - is there any documentation apart from the help? Some scripting guide? I have two problems:
    1) From its start position the rope always comes out at a fixed angle. I want it to rotate as if on a ball joint following the ropes angle exactly. I thought the best thing would be to add a very short segment but can't see how the segments are chained together.. Or is there a better way to do this?

    2) I want to extend the rope in code. Could you let me know how that is done?
    Thanks
     
  25. chimpanzee

    chimpanzee

    Joined:
    Aug 22, 2014
    Posts:
    1
    hi,guys,i'm a new player for rope editor,there is a problem.i want to change the RopeStart,but when i set RopeStart as a gameObject,There is no change.i try to call the function ChangeRopeDiameter to change RopeDiameter,is there any function with the same function to update RopeStart?
     
  26. bluesyhfang

    bluesyhfang

    Joined:
    Apr 4, 2014
    Posts:
    8
    Hi guys and UGTools,

    I was trying to change the rope length in runtime from another script using:
    Code (CSharp):
    1. ropeObject.GetComponent<UltimateRope> ().RopeNodes [0].fLength = ropeLength;
    I can see that in the inspector the length is changing but in the scene view it doesn't. Do you know why it is like this? or is there a better way to change the rope length in runtime from another script?

    Thanks!
     
  27. Leonard89

    Leonard89

    Joined:
    Sep 5, 2014
    Posts:
    1
    Hello Everyone,

    I am creating a 2D game set in space with zero gravity.

    The Player (big central ball) must be connected to a smaller ball with a rope.
    I made the connection correctly but when I move the ball player, the ball attached to the rope is fixed at the point. In addition, the rope stretches and begins to move in a strange way if the player is too far.

    Could someone tell me how to turn the ball around the player in the absence of gravity, but driven by the player?



    Sorry but I'm still at the beginning.
     
  28. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hey! you're still interested? :)
     
  29. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Sure! use the "Persist after playmode" option. Check it before hitting play, and it will save your rope state when you exit playmode. Uncheck it again after that.
     
  30. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    A couple questions:
    1. On your Asset Store page it says that this editor requires 4.x but in the description is says that it's been tested with 3.5.5. Will it work with 3.5.5 (Pro)? Are there any additional limitations when used with 3.5.5?

    2. What are the limits to the length of the rope? Have you run any tests of very long ropes?

    3. What are the limits to the amount of force / weight of objects attached to a rope? Have you run any tests of this?

    My finger is hovered over the "buy" button while I await your reply. ;)
     
  31. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    1 Yes, as it was mainly developed on 3.x. No known limitations :)
    2 You need to be careful with very long ropes, mainly because you need more links (= more expensive to compute and can make the system less stable). I don't have any specific numbers, what exactly do you want to do?
    3 It depends on the settings you give to the rope itself. If the links have very low mass and strength, then heavier objects will make it less stable. You need to finetune the parameters some iterations usually to get things right :)
     
  32. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    But that's true with ropes created using PhysX joints as well. How does your rope system improve on this? Can I, for example, pull a 1000 KG weight with a 100 M rope that weighs 0.1 KG/M? What happens if I wrap that same rope around a fixed collider and pull with the same force? A PhysX rope will be come unstable if I attempt this, but can your system handle it?
     
  33. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    27
    greetings. in need of a little help here. I wrote to UGT support but no word back yet. Perhaps someone here can help.

    I saw this on the UGT website:
    void ExtendRope(UltimateRope.ERopeExtensionMode eRopeExtensionMode, float fIncrement)

    and found this talked about briefly in this thread... but could someone please give me an example code to paste into a script that simply extends my rope +20.0 ? i am having trouble with it and not sure what else to try...

    also, I have many ropes in my scene, what is the best way to extend a specific a rope with this code from a script not attached to each individual rope? i created a tag for each rope so that i could find gameobject by tag... but again, i'm not sure how to format this code above.

    Thanks all.
     
    Last edited: Oct 31, 2014
  34. UGTools

    UGTools

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

    We rely on Unity's physics system, so we use their joints and indeed it is a known PhysX limitation. I'm hoping Unity 5 fixes this, but right now we will keep using Unity's physx so that every primitive will interact correctly with our ropes.

     
    Last edited: Nov 18, 2014
  35. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Try this:

    Code (csharp):
    1.  
    2. GameObject yourObject = ... // this is the object with the rope component
    3. UltimateRope rope = yourObject.GetComponent<UltimateRope>();
    4. rope.ExtendRope(UltimateRope.ERopeExtensionMode.LinearExtensionIncrement, 20.0f);
    5.  
    If you have tags then yourObject can be retrieved with:

    Code (csharp):
    1.  
    2. GameObject yourObject = GameObject.FindWithTag ("yourtag");
    3.  
     
  36. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    27
    That's great, thank you... That got me going but... one more question, then I think I'm good on my own...

    I have the above rope extension code within an if statement triggered by a GuiButton event. when I click my button, I do indeed get the rope extension, however, no matter what settings I play with, the rope always detaches/breaks off its first attachment (i have a procedural rope between 2 spheres).

    can you please tell me how to keep them attached. at a length of 20, the physics causes it to "snap" pretty hard, but i'd like to stay attached. i do have "link joint break force" set to infinity in both of the link dialogs.

    Thanks again.
     
  37. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Version 1.15 addressed this issue. It was uploaded not too long ago so you probably missed it :)

     
  38. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    27
    Yup, I bought it so recently, I thought I had the latest. An update got me going. sorry to waste your time on that bit. thanks again for the great/fast support. I love the plugin.
     
  39. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    27
    ok, sorry to bug you, i got another question... I have extensible turned on, everything is working fine to grow a ropes length... but a negative value doesn't shrink the rope. is there a way for me to do that? I could not find a method

    right now I have:
    • GameObject istrope1 = GameObject.Find("istrope1");
    • UltimateRope istrope1a = istrope1.GetComponent<UltimateRope>();
    • istrope1a.ExtendRope(UltimateRope.ERopeExtensionMode.LinearExtensionIncrement, -12.0);
    thanks again!
     
  40. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    You are probably trying to shrink a rope that is not extended. If you set the extensible length to 20, you can first extend it 20 additional units, and then shrink it 20 units, but not shrink it from the start.
    If you want that behaviour I would create a rope with, let's say, 20 extensible units and extend it on the editor 10 units. Before hitting stop, enable the "persist after playmode" checkbox. Once you exit playmode, disable the checkbox again, this way the next time you hit play you will be able to shrink or extend the rope 10 units from the start because you saved this state.
     
  41. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    27
    got it. ok, that makes sense. and i thought that might end up being the answer since i only saw a method for extending. i will try to extend in code first, if i have trouble, i'll do the persist trick.

    Thanks again for the great support. I wish more devs were like you.
     
  42. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    You're welcome! :)
     
  43. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    27
    I think I am still missing something... in converting my project to start with extended lengths, then shrink them, I noticed I am ending up with many more links in my rope segment than listed in the component gui. without extending, the number of links is always correct. after extending (and shrinking) I always have extra links.

    I am trying to keep my link number at a minimum because I have many ropes in my scene and the number of links seems expensive in terms of processing.

    any advice?
     
  44. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    27
    this is what I mean... the image shows 13 links listed in the inspector. i have a starting length of 1 and i am extending by 15 in c#. I don't know how many links are actually in that rope, but it's def slowing down my pc.
     

    Attached Files:

  45. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, the links in the GUI indicates the number of links in that segment _without_ the extension. The total number of links needs to be increased in order to have more rope length when you extend it.
     
  46. Jiraiya

    Jiraiya

    Joined:
    May 16, 2013
    Posts:
    12
    what is the best way to get a rope to settle/collide wthout jittering/ on a simple box collider?
     
  47. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello Jiraiya,

    Usually the best way is to assign the rope a physics material using the Ultimate Rope Editor panel and playing with the physics material friction values. Try using friction combine mode Minimum and setting low friction values.

     
  48. MSFX

    MSFX

    Joined:
    Sep 3, 2009
    Posts:
    116
    Hi,

    Could I make a piece of rope that the player could walk across that would wobble with this solution?

    M :)
     
  49. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Would it be 3D or 2.5D?
     
  50. MSFX

    MSFX

    Joined:
    Sep 3, 2009
    Posts:
    116
    it would be 3d..