Rope Sim - Using it for a new game by demand!!!

Hey I read awhile back that someone was looking for a good looking rope. I dont know if that request had been fulfilled or not but here is something I wrote up last night for a game that we are working on.

See a game 3D build using the script here:
Unity Drawing App

I moved the script to the wiki, click here to access it

Also I will post the “TubeRenderer”(3D) version of the script soon… Its done and working I just havn’t posted it yet! It even includes “Mesh Collider” for more accurate collision!

I wanted to share an update on a project I am working on. A few people showed interest in it so I decided to put a little more work into it! Video upload soon!

I would like to read a more indepth discussion on how you created the rope.

Very nice work!

Sure I will explain it and even post the code once I make it more user friendly (Meaning just drop the script in the object and go).

Right now I just wanted to post to see if anyone was interested in the code and if anyone else thought it was cool (I sure as heck did when it finally worked lol)

Anyway I will get back to this post in a day or 2!

I’d really like to hear more about how you did the rope. It is a great effect.

I have been trying to make a nice hose pipe without too much success. I was playing around with empty gameobjects and springjoints, visually joined together with line renderers. I couldn’t get the joints to work correctly and the pipe was flying all over the place.

I’m away from my dev box at the moment but as soon as I get back to the office I’ll give your code a test drive, I’m hoping it’ll get mine moving in a better direction.

As a hosepipe is quite a rigid object (compared to a rope) I wont need the resolution of 50 joints.

I’ll PM you with my project overview if I use your code as a base.

Many thanks,
Matt.

@ fallingbrickwork - COOL I hope this script will help you out!

I made a little physics based app using the concepts from the script last night, took me about 6 hours, check it out below!

Unity Drawing App! :twisted:

Cool! That looks great - thanks for sharing :smile:

Hey I was wondering why the rope was moving so slowly, and I realized that I forgot to add the variables to the “CharacterJoint” object that sets the values in it!

I updated the above code to include this information!

Also, don’t forget to mess with your settings under File > Project Settings > Physics. Sometimes the rope physics will be erratic depending on the size of your collision spheres and the penetration depth.

Freaking great! :smile:

You have just become my personal idol :slight_smile:

Very nice, thanks for sharing!!

Could you post a small example scene\projecy with a rope, please? :roll:

The rope behaves quite strange when I try to use you code in my project :frowning: .

I couldn’t get the rope working correctly lastnight… I have just seen you have updated the download. Many thanks, I’ll give the new version a spin.

+1 for this.

A small rope with a cube attached to both ends would be great for me. :wink:

Cheers again,
Matt.

Hey! I have attached a demo project folder to this post, hopefully it helps. If there is anything specific anyone needs help with please PM me and I will try to steer you in the right direction with this.

I suggest pressing Pause to see how the samples are kinda built and see what exactly is going on.

I will comment out what each variable does in the top script just so its there!

Hope this helps!

205283–7563–$ropedemo_167.zip (1.22 MB)

Thank you very much for sharing !
Unfortunally the ropes don´t cast shadows. Still the effect is very nice.

Yeah I know! Thats not such a good thing… But if anyone knows how to procedurally generate a tube mesh by using an array of vectors and binding them to the generated joint structure, we might be talking business ;)… cough

Hey jj55ee,

Do you plan to release your drawing app? I was just watching the video of it and it looks like a lot of fun!

Certainly something that would keep me and my 7yr old entertained for a few hours :slight_smile:

Jeff.

YES! But I am currently working on smoothing things out with it, the physics are sometimes sketchy but I have a pretty good grasp on what needs to be done to fix the issues. I am not sure yet how I am going to release it yet though.

I will let you know what I do release it! Thanks for your interest!

Great, thanks a lot for sharing ! Note : just adding a “Drag Rigidbody” script to the main camera allows direct manipulation of the suspended cubes, and of the ropes themselves.

Does this help?

http://www.unifycommunity.com/wiki/index.php?title=TubeRenderer

INDEED! After clicking that link, I do remember looking at that exact post awhile back… My stupid memory! Thanks for the help!

Here is a screen of the rope with a shadow!

205579--7572--$picture_3_562.png