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

38. Moving Platforms

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

In this chapter, we’ll focus on implementing a moving, floating platform that travels back and forth between two locations.

Making a platform move like this isn’t very hard. We’re experts now. We know how to move Transforms in world space, in local space, and from one point toward another point – we’ve done all that stuff before.

So the problem we’ll face with a moving platform is not getting it to move how we want it to move – rather, it’s getting everything sitting on top of the platform to move with it.

It’s a somewhat tricky situation. You might expect that having a Rigidbody ...

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.