Switches and Moving Platforms in UFPS

Sharing is caring:

Using Switches to Activate Moving Platforms

In this UFPS tutorial you’ll learn how to create moving platforms and switches for your game. We’ll start off by creating a basic platform that we can walk onto then apply a moving platform script. You’ll need to create waypoints in order to dictate the direction in which our platform will navigate to.

These waypoints can be made of any type of game object but to keep things simple (and ideal) we’ll use empty game objects, three of them to be exact. Name them with numerical values from 1 to 3, as these will act as references that our platform will use to determine which waypoint to proceed to next.

You can include many more waypoints, but for the sake of this tutorial we’ll stick with a small number. Once that has been completed you’ll want to make these waypoints a child object of another empty game object just to keep things tidy and to easily move all your waypoints.

After that, just add the waypoints as directed in the video and test out your scene. It should work by default using the ping pong type of physics movements.   In the second half of the video we’ll then go over how to activate this moving platform using a switch, a trigger, and even a collidertrigger.

For this we’ll start off with a prefab button model provided with UFPS. This will need a box collider (to detect our player/interacting objects) and our “platform switch” script. You can adjust the settings as show in the video to get a more specific effect that you desire. We’ll then take a look at how to create a simple trigger style switch using a cube.

This trigger will allow us to walk through it and activate our moving platform just the same. We’ll end the video by going over the last type of interaction which is the collider trigger. With this type of interaction you can collide with a game object and activate the moving platform once again.

This tutorial just covers the basics of creating a simple switch and moving platform system via waypoints but it should be a great starting point to create more intricate systems in your game.

Jonathan Gonzalez

I love all things in game development and want to contribute by teaching others how to create games. I'm always looking to help others create awesome digital worlds. I've been a hardcore gamer since I was a kid and now it's my turn to create awesome digital experiences.

More Posts - Website

Follow Me:
TwitterYouTube

Comments

  1. Hi jonathan
    thanks for your tutorial
    can i somewere download this scene?

    • Hello Koen,

      Unfortunately I don’t have these project files anymore. Even if I did I’d have to strip out nearly 95% of it due to a lot of paid assets being used. The textures, and UFPS character/switch are paid. The rest would just be untextured ProBuilder assets which really wouldn’t do much for you.

Speak Your Mind

*