- Home /
Creating a "bungee rope" between two characters
Hello, I'm creating a game for school, which involves 2 characters attached at the waist by a Bungee rope on a circular platform. They must attempt to knock each other off by using the spring in the bungee rope to launch at each other, the collision resulting in one of the players being pushed back. To do so, one player would "run away" from the other and once he gets close to the max length of the rope, would jump (resulting in 0 friction) and be catapulted at the other player, a rubber band effect if you will.
From what i've tested i'm getting the beginning of the behavior i'd like with a spring joint (or configurable joint) on each character, but they're by no means "launching at each other", and once the end of the rope is reached, character movement becomes erratic (moving up the Y axis etc)... I'd also like the link to be visible and solid, meaning if the players were at an angle around a pillar, the rope would bend around it, which would in turn affect the trajectory of a player if he jumped. This would suggest creating a "chain link" rope unless i am mistaken? How would i achieve this behavior using multiple objects to create a rope?
Am i on the right track? If anyone has any pointers or suggestions that could help i would be extremely grateful. Thank you for taking the time to read this !
Should be a fun one... Start off making a long chain of spring joints, see how that works.
Answer by Meltdown · Mar 12, 2012 at 09:33 PM
This is not an easy one. Take a look at some previous answers to get some ideas..
http://answers.unity3d.com/questions/22550/how-do-you-make-ropes.html
There is also a rope script that can be downloaded from here..
Answer by Tom21 · Mar 19, 2012 at 09:19 PM
Thank you for your suggestions. I did a lot of testing, using different joints, and so far the chain of spring joints is the best start (or hinge joints with spring turned on, basically the same), but it still is basically just a rope. I've been dabbling with the various parameters for hours, but nothing gives me that big spring effect i'm looking for, and i haven't managed to find any similar project online. Perhaps i'm going at it wrong but what set of numbers on spring joint would make the object rocket backwards? In space and set vertically with one fixed end, it works pretty well if i pull down on one end, it will bounce up, but horizontally (on a platform), the effect is near invisible... :(
Answer by Tom21 · Mar 19, 2012 at 11:40 PM
Aha! I've actually made lots of progress using an "InteractiveCloth"! Which i tried after seeing these videos http://forum.unity3d.com/threads/80533-Game-in-two-days-%29-Ropector ! Playing around with the parameter values has got me very close to the ideal behavior. Still have to iron out a few kinks where sometimes both characters go flying in random directions, and that when a collision occurs the force is transferred from one to the other though. Thanks again for your help!
Your answer
Follow this Question
Related Questions
Spring Joint 2D Strength? 0 Answers
Physics for multiple connections - advice needed 0 Answers
Grapple Gun Parkour 0 Answers
Problems with Spring Joint 2D 1 Answer
Change springjoint2D connected anchor to where the player is facing (Y-axis) 0 Answers