top of page

Physics-Based Game Prototype - Simulate Rope with Character Joints in Unity 4.5

Rope Overview

There are moments in the game where the wrecking ball will be connected to the player via a rope because it's either on the ground or hanging over a ledge. Since the rope is near the player, the rope needed to move realistically. The main goal was to create rope that can coil, handle and pull heavy objects, swinging around, and remain intact without the physics causing the rope to stretch or behave erratically. To accomplish this, I decided to use Unity's Character Joints to recreate the physics of rope. 

Date: October, 2014

Segments and Joints

The rope is made up of a series of points in 3D space. These points are connected together via joints, which create rope segments and lets the points rotate around each other. By using Character Joints and keeping these points close together, the physics can simulate the movement of rope. The key here is to keep the segments close together so that the rope look like one long piece of rope and not a rope with distinguishable rods. The number of points generated is based on the distance between the wrecking ball and the anchor point. This was done because the distance between the player and the wrecking ball can vary depending on how far the ball is launched.

Character Joints vs. Spring Joints

The decision to use Character Joints came from trying to use Spring Joints to connect the segments. Spring Joints are designed to let two Rigidbodies join together, but their distance can vary since the joint is designed to work as a spring. This doesn't work well for making a rope because it makes the rope seem like it's stretching and and bouncing. Character Joints, however, work like a ball-and-socket where you can limit the twist and swing of the joint, but their distance is mostly consistent. Changing these values and arranging the segments close together lets me create rope segments that can rotate enough to make rope coil and move around without the stretching and bounce that comes from using Spring Joints.

© Portfolio by Luis Andrade. Proudly created with Wix.com

bottom of page