Search Unity

Rope Script V2 now availiable - 8/08/10

Discussion in 'Made With Unity' started by reveriejake, Nov 19, 2009.

?

Should I continue to support this script

  1. Yes I need this script and appreciate your support!

    94.4%
  2. I think its fine how it is!

    3.2%
  3. I know enough about programming to fix it myself!

    2.5%
  1. JLorinser

    JLorinser

    Joined:
    Feb 15, 2010
    Posts:
    1
    I want a rope for a crane, but I need it to be able to lower/rise the hook at the end. This rope looks great but is there a way of changing its length on the fly?

    Thanks and keep up the great work!
     
  2. Marc Coleman

    Marc Coleman

    Joined:
    Mar 6, 2010
    Posts:
    1
    Great scripts. I just needed them in C# so I thought I would share them with everyone else as well.
     

    Attached Files:

  3. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Awesome thanks for doing that!

    Sorry guys and girls for not doing any updates on the scripts, I have been pretty busy with other projects and my real job!

    Feel free to alter those scripts and improve them then repost!

    Later!

    Jake
     
  4. siguman

    siguman

    Joined:
    May 12, 2010
    Posts:
    6
    "BCE0018: The name 'TubeVertex' does not denote a valid type."

    Unity wont let me assign the script and I just keep getting this error. What is the problem?

    Sigurd
     
  5. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Include the second script in your project called tubevertex. You. An find it below the rope script on the wiki page.
     
  6. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
  7. siguman

    siguman

    Joined:
    May 12, 2010
    Posts:
    6
    Thank you for the help and for the really fast response!:)
     
  8. Gibbs

    Gibbs

    Joined:
    Jan 8, 2010
    Posts:
    26
    How do I get it from acting so chaotic. Problem is that I'm able to link it between two objects however it continues to keep falling then it goes chaotic. I tried to decrease the springy-ness but it still doesn't appropriately get the effect I see in your pics.
     
  9. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    hmm, its been awhile sense Ive messed with the script. So my question is, what is the mass of the object that isn't kinematic? If its got a large mass, then it could be your issue.

    I havnt been able to add to the script any but maybe in a month I will be able to release a proper script to the community.
     
  10. Vert

    Vert

    Joined:
    Mar 23, 2010
    Posts:
    1,099
    Played around with the demo, the default rope never stops swinging. Also I moved the end point of the rope and then it falls and go's chaotic without touching any of the physics settings for the rope or the game world. Eventually it corrects itself, but again, it does not stop swinging. Other than that, this is my first time looking at it, its a very nice thing you have coded up for the community.
     
  11. caitlyn

    caitlyn

    Joined:
    Jun 20, 2008
    Posts:
    402
    This is a great piece of work. Nice job. I tried to rig something like this once in my free time and never got results as nice as yours.

    Way to go! :)
     
  12. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    I would like to second the request for help on "lowering" the rope's end. I'm building the same crane-type contraption, and need to lower the hook which hangs from the end of the rope.

    Messing about with all sorts of options atm, but so far no luck :(

    Thanks for this great gift to the community!!!
     
  13. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Hey guys. I have been getting feature requests as well as a few complaints about how the rope is acting. So I have decided to build a brand new system and release it to the public within the next couple weeks. The new system is going to incorporate much of what people were asking for through emails and PMs as well as (hopefully) the ability to pick up object and break in half if so desired. Below is a list of new features I am going to add to the rope system!

    New rope features include:

    • -Ability to lift objects (Like a crane)
      -Ability to use prefabs instead of the 3d mesh (for chain links)
      -Skin is now going to be bound to the joints to improve performance (Where as before the mesh was created every frame)
      -New re-written C# scripts
      -Improved collision detection
      -Improved editor to create/edit your rope creation
      -AND MORE!

    PM me or Email me for feature requests!

    Hope everyone enjoys the new script once its released!
    Jake
     
  14. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    This is more than awesome, this is...whatever is better :D Really can't thank you enough, exactly what I need for my project (one of 'em, lol), and just super helpful in all sorts of ways :)

    Thanks!!
     
  15. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    This is awsome!! Thank you for listening and your programing skills!

    Btw.. Have you tried cloth in the new beta version?
     
  16. tieren1

    tieren1

    Joined:
    Jul 21, 2010
    Posts:
    2
    Hey there, one question for the old rope script. How can i attached my character onto the rope and make it swing across platforms? I saw some one posted this but i still can't figure it out with that. Any form of help is appreciated. :)
     
  17. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819

    Hey thanks and yes I have tried the cloth out. I don't think that the cloth would do much good in this case however I am open to making my life and everybody elses life simpler. If it so happens that cloth rope works then that's what the final product might be. That still will not answer the "can I use my own prefab links for chains" question though and I will continue to pursue that!

    Another feature I didnt mention will be a list of presets that are going to be included so you no longer have to find that perfect setting (In theory).

    Take care!

    You will have to use the sphere colliders to detect at what point on the rope your character is attached at. Like I mentioned in an email to someone else, its possible, I just don't have any second hand scripts I can give out on that.

    Sorry,
    Jake
     
  18. tieren1

    tieren1

    Joined:
    Jul 21, 2010
    Posts:
    2
    hey thanks for the quick respond man. Really appreciate your help. One thing is how can i get the sphere coliders? It comes with the original rope right? If so can you give me a start up to this? as i really have no clue on how to do this. :?
     
  19. Alex Mat

    Alex Mat

    Joined:
    May 14, 2010
    Posts:
    177
    Great work! :)

    I have a request, can you make the rope breakable?
     
  20. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Yeah I am going to try and add that into this version however there are not any guarantees.
     
  21. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Here are some images!

    Image 1: A new feature that will make dragging chain or rope across objects more fluid is the use of capsule colliders instead of sphere colliders!

    Image 2: These are the new settings that are now available to you (Might be more on release). Of course before the release I will simplify these a bit and make an actual separate editor for these settings so its not so daunting.

    Image 3: Chain links in action! As I said before, now your going to be able to use your own link prefab instead of having to use the TubeRenderer!

    AND Here is a video!
    http://vimeo.com/13539700

    Hopefully I will be releasing this around the release of Unity 3 because there will be some features on the rope that are new in Unity 3.

    Until next time!
    Jake
     

    Attached Files:

  22. Dwair

    Dwair

    Joined:
    Jun 13, 2009
    Posts:
    11
    Beautiful improvements!

    I'm using your current rope script (slightly modified for using it on iPhone) in a Kite sim prototype, and it works fine except for a few problems with hinge joints at kite's end...don't worry, is my fault ;)

    But I'm sure your new version will be much easier to use in my case with the lift feature, two thumbs up and keep up the good work!
     
  23. afalk

    afalk

    Joined:
    Jun 21, 2010
    Posts:
    164
    What an outstanding bit of work! Very much looking forward to seeing all the new enhancements - the video and latest info you shared look amazing! :D

    THANK you for sharing your work with us out here!
     
  24. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    Looks great, seems almost that you Are making it for me :).
    I see that you are using capsule colliders on the chain, I hope that you can use a box collider that fits each chain link better, for improved accuracy on handling the chain ....

    Are you able to drag the chain across the floor, when you have ca 10 ton object on the end? Each chain link should be 70 kilo! It is a very hard test for the physx engine... it gets elastic ...

    can you test this for me?
     
  25. Guru

    Guru

    Joined:
    Apr 30, 2010
    Posts:
    118
    Very nice! I just wanted to thank you for the time and effort put into this. I have made plenty of use out of the original rope you released, dissected it and made changes to what I need it to do but it would have taken me much longer to get there without what you have provided.

    Look forward to taking a look at the next version and Unity 3 as well.
     
  26. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Hey thanks! I always like to hear happy users! I think everyone will be pretty happy with the new version but I am also sure there will be some bugs to work out as was the case with the first version. If anything I hope that people get inspired to create games after playing with this toy!

    Jake
     
  27. immFX

    immFX

    Joined:
    Mar 20, 2010
    Posts:
    110
    I have managed to use the rope script effectively in my project. Thank you for this great script.

    However, since I'm trying to simulate a rope that is being pulled by a rotating winch, I'm wondering if you have any code snippets that control the length of the rope in real time, i.e inside LateUpdate() and not in the Build() function.

    If not, will the new version support this?
     
  28. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    I was actually thinking of ways to do this a few days ago. Of it doesn't make it into the first build ill have to include it in the next update to version 2.

    Also to everyone who uses this script. I might decide to sell the latest version for $5 per download. I hate charging money for this stuff but I've spent many hours working on these scripts to make them compact and easy to use. Don't fear though! As of right now its going to be free but there is a donation button below the soon to be download link on my website.
     
  29. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    I will gladly pay you the money, it is such a small amount anywAy!
     
  30. ClayManZ

    ClayManZ

    Joined:
    Apr 30, 2009
    Posts:
    26
    I really like your work!

    I tried to build a fully interactive mobile-crane since 2005 (using DarkBasic and DarkPhysics in the meantime). I've never suceeded building a stable result, so I dropped the idea.

    With your solution it seems it could be realized. If you succeed implementing a length-controllable rope, I will donate for sure.


    Greetings
     
  31. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Update: The rope now has a procedurally generated mesh that is controlled by bones! This is one of the large hurtles in the development that I was hoping to get over...

    The frame-rate is >300 with 6 ropes or >1100 with 1 rope in camera view and 40 joints on a macbook.

    Also I opened up the option to allow the rope to be active when its not in view.

    More to come,
    Jake
     
  32. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    Sounds very excellent... cant wait to try it out! Please update us on video also..

    So performance on lets say 100 chain links is expected to be quite high? over 100 fps?

    So when do you think you can release a version for us?
     
  33. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Oh yeah the performance will be great. Of course that depends on what machine your running on.

    I will release a video late tonight (Probably by 1AM EST) but as for a release, I am probably not going to be releasing for a few weeks. I would however like to find someone with Unity 3.0 beta who uses this script a lot to help me test out the functionality and provide input.
     
  34. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Sorry about not posting the video tonight guys. I will try and post it tomorrow!

    Jake
     
  35. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    I will gladly help you with the testing, I have the beta, I also have quite some experience on using rope physics, Newton on quest3d, beta tester for physx for quest... But I only have some spare time in the evening at the moment, but might get some work hours also...

    But I am a user, and don't really see myself as a programmer, so don't expect me to follow you in the programming side all the way :)
     
  36. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    I just uploaded the latest video to vimeo showing some of the features in action.

    Keep in mind that this is still very glitchy and before the script is released the code will be cleaned and more user friendly ;).

    or here --> http://vimeo.com/13685148

    Jake
     
    Last edited: Jan 2, 2013
  37. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Hey guys/gals!

    I just wanted to post an updated photo of my script.

    Also I will be posting a video in the "Videos" section of my website of the pictured crane in action (Also available on Vimeo).

    For now, Enjoy the photo, and look for the official script release!

    Jake
     

    Attached Files:

  38. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Hey Jake,
    I like it! :) How did you do your chain? It looks very realistic in the screen shot, are the links individually modeled?
     
  39. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Each link is a model prefab. I have new settings in the script that allows you to set the scale and direction of the links. It takes a minute of tweaking but the end result looks amazing as you can see in the picture and the soon to come video!

    jake

    EDIT: Oh and another photo I forgot to post awhile back.
     

    Attached Files:

  40. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
  41. ClayManZ

    ClayManZ

    Joined:
    Apr 30, 2009
    Posts:
    26
    I've tested it, getting several errors.

    I'm using
    - Windows Vista
    - Unity 3 b4
    - a new project with the package imported successfully

    When the ropes are initialized, many errors occure saying 'mass is 0.000000' or 'mass must be a positive value'

    While I can rotate the rope-chain, the crane isn't responding, as you can see in this screenshot:


    Anyway, it is looking superb, framerate is good!
    Greetings
     

    Attached Files:

  42. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I -just- reported the same issue via PM! ;)
     
  43. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Hey guys! Sorry about that, I must have made a mistake when I saved the scene.

    FIX: Click the "Crane" object and UNCHECK "Static" and click "Yes, change children".

    Don't worry about the error "Body::setMass: mass is 0.000000, should be positive!" error. In order to get the chain to behave correctly I had to turn the mass of the links down to zero. I havn't realized any issues with doing this but I hope to find a solution with less compiler complains ;)!

    Hopefully this helps and thanks for reporting the issue guys!

    PS: Download files are now updated so this should no longer be an issue!

    Jake
     
  44. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Hey guys/gals! This will probably be my last post with a video before the official script is released!

    The video primarily features the chain links ability to break towards the end of the video. I got rid of all jitter with this version as well as fixing the list of errors complaining about mass being equal to zero. Now you can set your mass 0.1 or whatever you'd like without the chain acting crazy!

    Thanks again to those who are helping with the testing of the script and I look forward to seeing the final project featured in some awesome new physics games!

    VIDEO: http://vimeo.com/13814046

    Oh, I almost forgot to mention, there are 3 scripts that are not featuered in the scene and video that are going to be available for download on my site. The first script is for the easy to use multi-view system. The second and third scripts are for the piston (seen on the back of the crane) and for the zip-line control seen on the A-frame setup!

    Jake
     
  45. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    GREAT work! been testing all day :)

    PS the piston you mentioned, can you make it physics driven :)
     
  46. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    I know some physics systems out there include a slider joint but I am not sure that PhysX does. You would probably know more about that than I do. If it doesnt have slider joints I might be able to throw something together using rigidbodies and forces.

    I will see what I can do!

    And again thanks for all of your help and support!

    Jake
     
  47. pixelone

    pixelone

    Joined:
    Apr 16, 2010
    Posts:
    157
    @jj55ee This is EXCELLENT! Hey, it's programmers like you that make the world go around :)

    I have not tried this. I am at work can't wait to get home to test. Real quick -

    Do I make my character the target for the end so when he/she runs and jumps it latches to the rope at whatever point the collide with it? Is it really that simple?
     
  48. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    150
    Not quite sure what you meant, but yes, you attach the rope between two object and then starts the scene and the rope is created!

    Ps: I found out how to use configurable joint as a force driven piston...
     
  49. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Actually in that situation you would make the end of the rope an empty game object. As for your character you would have to come up with your own script to make him/her attach to the ripe and climb it. Although I might write a simple climbing script after I'm done with the rope and post it on my site to help you guys out.
     
  50. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    OK! So I lied, I will release one more video, but I am very close to finishing the script!

    CHAIN IN 30 SECONDS:
    http://vimeo.com/13974740

    The official script will be available 8/08/10 by 11:59pm EST (23:59 EST). The link on my site will say "Download" and not "Source(Alpha)".


    Please donate if you use this script. There is a lot of time that went into this script. Some 80 hours or more working bugs and implementing new features. If you were to hire a programmer to do this work you would have spent c.$1900 or more just for this one script.


    Thanks and I hope everyone who uses this will find inspiration instead of frustration.

    Jake