© Casey Hardman  2020
C. HardmanGame Programming with Unity and C#https://doi.org/10.1007/978-1-4842-5656-5_39

39. Joints and Swings

Casey Hardman1 
(1)
West Palm Beach, FL, USA
 

This chapter will go over an example of some basic usage of a physics component called the Configurable Joint, which can be used to bind GameObjects together with the physics system. We’ll use it to create a chain of objects, each one attached to the one above it to create something like a rope. At the bottom of the rope, we’ll attach a platform that will swing with the rope. Our player can use their “telekinesis” to pull the swing or its joints and then jump on the platform to ride it.

Swing Setup

Let’s set up the GameObjects of our swing first so they’re all ready to be connected ...

Get Game Programming with Unity and C#: A Complete Beginner’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.