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

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, you can force a rope regeneration by calling SendMessage with methodname = Regenerate and parameter false on the rope's GameObject:
    rope.SendMessage("Regenerate", false);
     
  2. Alex-Chouls

    Alex-Chouls

    Joined:
    Mar 24, 2009
    Posts:
    2,657
    Perfect, thanks! Great plugin BTW :)
     
  3. DragonSlay89

    DragonSlay89

    Joined:
    Apr 13, 2013
    Posts:
    1
    Hey, thanks for a great plugin! With the same technique as described above (playmaker using ultimate rope), how do I set and control the Segment End object via playmaker? The "RopeStart" appears in the list using SetProperty, but an option for "Segment End" is not in the list. Does it have an other name? Or should I set it from playmaker using a send message command or something, as you suggested for the Regenerate command?

    Thnx for any advice!
     
  4. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Thanks man! :)
     
  5. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Woops! sorry for the late reply. It seems the forums don't send me notification messages anymore. Any way to fix this?
    Regarding the segment end, this is maybe a bit trickier. I would need to ask Alex how PlayMaker handles "custom" properties, because internally the segments is an array of objects and not properties per se.
    In theory you could access this information, but I don't know if PlayMaker allows access to arrays of objects.
     
  6. rainonrooftop

    rainonrooftop

    Joined:
    Apr 18, 2013
    Posts:
    6
    Has anyone run into any problems with the rope editor not playing nice with the new Unity update?
     
  7. Alex-Chouls

    Alex-Chouls

    Joined:
    Mar 24, 2009
    Posts:
    2,657
    It sounds like it might need a simple custom action. I'll take a look, and also PM you a coupon to download Playmaker if you have time to test on your end...
     
  8. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    What happens exactly and which version is it? I'll have a look ASAP :)
     
  9. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Thanks Alex! Sure, I'd be glad to test it. Also I'm currently finishing a new editor extension (news soon!), and will try to make everything Playmaker-friendly since so many people seem to use it nowadays.
    I'll keep you guys posted.
     
  10. rainonrooftop

    rainonrooftop

    Joined:
    Apr 18, 2013
    Posts:
    6
    Nevermind, I got it. Thanks for your quick response anyway. Keep up the good work, this editor is great.
     
    Last edited: Apr 19, 2013
  11. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Thanks man! Good to know you fixed it. If you need any more help just use the forum or contact me by e-mail: info at ultimategametools dot com.
     
  12. davedev

    davedev

    Joined:
    Jan 12, 2009
    Posts:
    74
    I am trying to create my first rope using URE in Unity 4.1.2. I added a rope to my scene and gameobjects at x=100 and x=-100 and added these as Rope Start and Rope Segment 1, Segment End. I leave the rest of the parameters to their defaults. I run this and I get a very jittery pink line rather than a proper rope. Is this expected? How can I set up a basic rope?
     
  13. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    That's 200 units separation. Set the segment length to 300 and that should make the rope appear. The default length value if I remember correctly is 5 or so.
    In any case, it is a good practice to work with a smaller scale (unless you were actually trying to make a very long rope of course). I usually work with 1 unit = 1 meter,
     
  14. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Also, the pink color is because you didn't set any rope material yet. But maybe you figured that one out already :)
     
  15. davedev

    davedev

    Joined:
    Jan 12, 2009
    Posts:
    74
    Thanks. That worked. I had tried some other lengths, but not that high. Makes sense.
     
  16. davedev

    davedev

    Joined:
    Jan 12, 2009
    Posts:
    74
    Another question, is it possible to drag a part of the rope and then release it? I have a rope strung between two gameobjects with more gameobjects "sitting" on the rope and want the user to be able to click anywhere on the rope and drag downward. Releasing the rope flings the game objects in the air like a bow string. I have some of the motion I need by sliding the end point of the rope left and write.
     
  17. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I'm afraid the ropes don't have any elastic capabilities, this is basically a limitation imposed by how joints work in Unity (and internally, a limitation of PhysX which is the physics engine that Unity uses). You may stretch them a bit, and there will be a somewhat weak slingshot effect, but as soon as you pull the rope too much over its length limit then all joints will go crazy trying to go back to a rest pose. It is the same behavior you had when you placed the rope nodes 200 units away and the rope was too short.

    My first suggestion would be trying to fake it by finding out which Y position is the limit where the rope physics break and making sure that's the limit for the slingshot. Then applying a manual force (rigidbody.AddForce) to the links the user is dragging when he releases the rope, and maybe additionally to some of the objects above. But I'm not sure if this will work because you want to stretch the rope way over the limit to go for a big slingshot...
     
  18. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hi UGTools , Does Ultimate Rope Editor support 2d ropes?
     
  19. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, you can select all rigidbodies of the rope links and constrain them to move only in the XY plane :)
     
  20. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Great! Thanks for replying! Definitely on my shopping list!
     
  21. TimB

    TimB

    Joined:
    Jan 19, 2011
    Posts:
    65
    Have you tested this out? I tried it and had some very strange and erratic results. Lots of random rope jumping. Can you post the rope settings you have success with for constraining to 2d? Thanks
     
  22. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, I've tested it. You just need to select all children of the rope, which are the links, and change the constraint setting in the rigidbody component. If you want to limit the rope to move in the XY plane you only need to mark the checkbox of the Z position :)

     
  23. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Can this be used to make tank treads?
    I'd love if I could only set up wheels + this tool and have my tanks up and running.
     
  24. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    No but there's a package on the Asset Store just for that. I haven't tested it personally but it looks nice:
    https://www.assetstore.unity3d.com/#/content/2018

     
  25. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Not good for me because I can't use the wheel collider :(
     
  26. Z3R0Skull

    Z3R0Skull

    Joined:
    May 15, 2013
    Posts:
    5
    Anything new about mobile compatibility? I mean performance?
     
  27. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It is fully compatible with mobiles. What we don't have are performance tests with exact numbers if that's what you're asking for. It's on our to-do list :)

     
  28. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    Hi, I recently bought URP, and so far it's working quite well, I have now run into a problem however.

    In the scene I've attached I have an airship that I want to pull in to the dock using harpoon guns, however the attachment between the harpoon and the ship is horrible.
    I'm connecting ship and harpoon using a fixed joint, but it's gliding all over the place

    Is there a better way to do this that I haven't thought of?

    https://dl.dropboxusercontent.com/u/6338532/Starboard Skies/Starboard Skies RopeBug.html

    EDIT
    Press G to fire the harpoons
     
    Last edited: Jun 1, 2013
  29. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    Oh I forgot, press g to fire harpoons, sorry about that.
     
  30. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello Mr Logan!

    It's a common problem with physx that I personally hate :)
    I normally use the Configurable Joint which has a lot more parameters and can be used to build any other joint. To make a fixed joint just set all motion parameters to "locked", and then to avoid the gliding try changing the "Projection Mode" to "Position Only" and the "Projection Distance" to a small value. Hope that helps!

     
  31. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    What is the mass of those objects?
     
  32. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    @UGTools
    I tried with the configurable joint and your setup, but the gliding is just about the same.

    @Megmaltese
    The "harpoon" copies the mass of the object it's attached to, in this case the hull has a mass of 10, and therefore, so does the harpoon.
    The balloon has a mass of 100, the links however have a mass of 0.5. I just tried setting them to 10 too, and the result was even more erratic than originally.


    I've discovered that setting a lower fixed timestep has a small effect on it, but I'd prefer if this was possible without putting too much strain on my computer.

    Would it somehow be possible to attacch the rope directly onto the ship at the point comparable to where the harpoon has hit? And would that even work?
     
  33. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    It definetly shouldn't glide that much, I've had setups like that for cranes and similar scenarios and finetuning the masses and the projection distance should be enough. Maybe the mass center and the difference between sizes can have some effect on it too...
    In this case what you can do is get the relative positions of the harpoons with respect to the ship once you detect the hit and create the joint, and force this position on each LateUpdate() so that even if the physics move the harpoons a bit, they stay in the same position later for rendering.

     
  34. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    My first suggestion always is as usual to NOT use 1 mass unit = 1 kilo.
    That's completely incorrect. The system results much more stable if you assume 1 mass unit = 1 ton.
    Try this please and let me know if you have any increase in stability.
     
  35. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    Well, setting position and rotation in lateupdate makes the harpoon stay in place, however the rope is doing the "gliding" now instead.

    Also, I'm aware that mass is an arbitrary value, and currently I'm just setting it as the balloon needs to be much heavier than the boat, and the boat needs to be massive compared to other objects.


    I'm starting to think it might be because the "ExtendRope" function isn't taking the pull of the boat into consideration. In real life it would be pulling the rope in slower if the boat was tugging in the opposite direction, but this is rather ruthlessly just pulling the rigidbody at a fixed speed.
     
  36. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Indeed, the ExtendRope doesn't take any force into account, you just use it to increase/decrease the rope length no matter what's attached. But that's not the problem with the gliding, I'm pretty sure now that the problem is in fact the big size difference between the ship and the harpoons. Joints in PhysX are a bit of a pain in the ass to work with because they are very unstable in many situations and their behavior depends heavily on the properties of the rigidbodies attached than the properties of the joint itself.

    Instead of creating a fixed joint, try making the harpoons children of the boat. That should get rid of the gliding and I think it should have no effect on the behavior of the rope...

     
  37. TimB

    TimB

    Joined:
    Jan 19, 2011
    Posts:
    65
    Any thoughts on how would I go about programmatically breaking a rope? I've tried removing the joint, and I think this works, except the mesh is still attached. Do I need to remove one of the bones too? If so, any idea how to get that bone information?
     
  38. TimB

    TimB

    Joined:
    Jan 19, 2011
    Posts:
    65
    Looks like the mesh rebuild on break is only checked for if break force or break torque is not set to infinity. So, I just remove the joint and set one of those to an insanely high number. Seems to work.
     
  39. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, that would indeed be the correct solution. If the force and torque are both set to infinity then the mesh is optimized but can't be broken. If one or both isn't infinity then you need additional vertices and faces for the snaps...

     
  40. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hello,

    I bought QuickRopes2 before you released this and I'm looking at replacing it with yours in my game. I'm having some issues with it on Android devices. I have an object attached to a rope that I use as a crane. The rope moved up and down (kind of like an elevator) with the object attached to it and the player can ride the object. The issue is the object disconnects from the rope at the start of the scene.


    Can your rope system accomplish this?
    If so, have you seen any issues at all with your rope system at all in mobile devices?

    Thanks
     
  41. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    By riding the object you mean stand on it? what kind of problems are you having exactly?

     
  42. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    $SShot.jpg

    Hello,

    Yes, the player can jump on to the attached object (Cargo container) and ride it up and down (see attached pic)

    The issue is I have 7 of these cargo containers in a level, they are suspended in the air by the ropes, the player can then flip a switch and some of the ropes start to move up and down. This then moves the cargo containers up and down.

    What's happening with Quickropes2 is some of the cargo containers disconnect themselves at the start of the level so the cargo containers are on the floor instead of being suspended by the ropes.

    When I contacted the developer of Quickropes2, he stated that it's a bit flakey on mobile devices, so that's why I'm looking for an alternative.

    Thanks so much,
     
    Last edited: Jun 10, 2013
  43. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I see no problem with that setup in our case. The only thing is I'd probably be careful with is the amount of physical detail you put on each rope (the number of links). and maybe adding some sort of culling to enable/disable ropes when they're not active/visible.
    In any case, I'm here to help you with any problems you may encounter :)


     
    Last edited: Jun 10, 2013
  44. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Hello,

    I just bought this an I'm having an issue extending the rope with script.

    Here is my script called in an update:

    Code (csharp):
    1.     if(ropeState == RopeState.down){
    2.             m_fRopeExtension += Time.deltaTime * RopeExtensionSpeed;
    3.  
    4.             m_fRopeExtension = Mathf.Clamp(m_fRopeExtension, 0.0f, Rope.ExtensibleLength);
    5.             Rope.ExtendRope(UltimateRope.ERopeExtensionMode.LinearExtensionIncrement,  m_fRopeExtension - Rope.m_fCurrentExtension);
    6.  
    7.     }
    When it get's activated I get the following warning:

    The rope extends but does not stop at the extendable Length point, it disconnects itself from the rope start transform and just falls

    Thanks,
     
  45. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I thought this update was already sent to the asset store a while ago!
    The fix is simple, modify the code (UltimateRope.cs) around line 2512

    Change:

    Code (csharp):
    1.  
    2. if(Mathf.Approximately(fActualRopeIncrement, 0.0f) == false)
    3. {
    4.     CoilObject.transform.Rotate(GetAxisVector(CoilAxisRight, 1.0f) * fActualRopeIncrementAngle);
    5.     SetupCoilBones(m_fCurrentCoilLength - fActualRopeIncrement);
    6. }
    For this:

    Code (csharp):
    1. if(Mathf.Approximately(fActualRopeIncrement, 0.0f) == false)
    2. {
    3.     if(FirstNodeIsCoil())
    4.     {
    5.          CoilObject.transform.Rotate(GetAxisVector(CoilAxisRight, 1.0f) * fActualRopeIncrementAngle);
    6.          SetupCoilBones(m_fCurrentCoilLength - fActualRopeIncrement);
    7.     }
    8. }
    9.  

     
  46. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Thanks

    That fixed it,

    Just to let you know, I'm also getting yellow cautions:


    Assets/Ultimate Game Tools/RopeEditor/Scripts/UltimateRope.cs(2851,24): warning CS0618: `UnityEngine.GameObject.SetActiveRecursively(bool)' is obsolete: `gameObject.SetActiveRecursively() is obsolete. Use GameObject.SetActive(), which is now inherited by children.'

    Assets/Ultimate Game Tools/RopeEditor/Scripts/UltimateRope.cs(2709,24): warning CS0618: `UnityEngine.GameObject.SetActiveRecursively(bool)' is obsolete: `gameObject.SetActiveRecursively() is obsolete. Use GameObject.SetActive(), which is now inherited by children.'
     
  47. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I see, that's something that changed from 3.5 to 4.x. It doesn't affect negatively in any case but I will send those two updates to the asset store to get rid of the messages. Thanks for the heads up!


     
  48. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    Great thanks,

    One more question,

    How can I reset the rope to it's original position via script? I see the button in the inspector, but I can't seem to access it via script.

    Thanks,
     
  49. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Just use rope.Regenerate(). If you're using dynamic rigidbodies for any node segment and you're having problems, try using rope.Regenerate(true).
     
  50. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hello, I've started testing this rope system as a way to create a dynamic "chain" for my character. In this case the dangling end of the character's hood (skinned joints which are part of the character's rig).

    The results look promising but I'm having two issues: when I drag and drop the first and last joints of the chain into the "Ultimate Rope" script the joints in the middle of the chain get moved out of the character's hierarchy, which in turn breaks the character's prefab (which is obviously a big problem).

    On top of that, Mecanim is of course unhappy about the changes in the character's structure and spits a series of messages:

    [mecanim]: BindSkeleton: cannot find Transform 'Bip01__Hood1'
    [mecanim]: BindSkeleton: cannot find Transform 'Bip01__Hood2'
    [mecanim]: BindSkeleton: cannot find Transform 'Bip01__Hood3'
    ...

    Basically several message per chain joint. Which doesn't look right.

    So I'm sure I must be doing something very silly here. I've attached a screen grab of the script's inspector. Could you please help me with this? Thanks... $ScreenShot275.jpg