Adding a Moving Platform in 3D Game Kit

Revisado con versión: 2018.1

-

Dificultad: Principiante

We’ll be adding a moving platform to our scene. All interactables are in Prefabs > Interactables

To add a MovingPlatform:

  • Navigate to the Project Window

  • Go to Assets > 3DGameKit > Prefabs > Interactables

  • Left Click and Drag MovingPlatform into the Scene View

  • Use the Transform Tools to Translate (W), Rotate (E) and Scale (R) the platform where you like.

  • At the top of the Editor, Press Play

The MovingPlatform will be stationary. Let’s make it move:

  • Locate the End Point Tool on the MovingPlatform in the Scene View

  • Navigate to the Inspector

  • In the Simple Translator Component

  • Use the Preview Position slider to view where the Platform will go

  • In the Simple Translator Component, tick the Activate box

  • Press Play

Your MovingPlatform will move up and will stop when it reaches the top of the path you have set.

Let’s make this move back and forth, with the MovingPlatfrom selected:

  • Navigate to the Inspector

  • In the Simple Translator Script

  • Set Loop Type to Ping Pong

  • Press Play

The MovingPlatform will now move to the top and come back down again. The MovingPlatfrom will go to any position you set as the End Point.