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