Any suggestions for drawing a harpoon's rope?

For reference, its a 3 player game, each player controlling part of "Player Object." One of the players is suppose to shoot something like a harpoon as passing power ups (top down view). I was going to go with a ray cast to start, but it doesn't work well for various reasons.

So I figured I'd just shoot a projectile, but I'm not sure how to do the "rope" aspect of a harpoon. It would be nice if it followed the projectile, while being attached to the firing point, and behaved like a rope. I plan on making the whole thing disappear a few seconds after firing (or on successful hit) but I'm just not sure what to use to draw something like that rope. Maybe a rag doll? I haven't used one yet in my first 6 weeks of Unity.

Any suggestions would be most appreciated!

1 Answer

1

My first thought would be using Hinge Joints (and maybe Fixed Joints). Split up the rope in segments and connect them to each other. This way the segments will always be connected and will look like a moving rope. More info about Hinge Joints can be found in the Script Reference: link

If you have the bootcamp demo installed, you can find an example of the use of hinge joints in the building at the end of the mission. In this building there's a lamp, hanging by a rope on the seiling. This rope is made by using Hinge Joints.

I hope this helps ;)

P.S. You need Unity 3.0 to be able to use Hinge Joints

take a look at some of the "standard scripts" in the assets folder when you add all the packages. Especially those with camera/mouse movement, as they contain some very inspiring calculations on how to find stuff.

Actually, no, hinge joints have been in Physx for longer than Unity 3.0 has been around. They are definitely available in 2.x. Maybe your thinking of cloth simulations?