Building A Lift
  • This is based on AEC Blueprints by Example
  • I want to build a platform that moves the player from one height to another.
  • This is based on the timeline node
  • As well as the lerp node.
  • Overview
    • My Levitator will just move from one position to another.
    • I has a single component, a squashed cube (for a platform to ride on)
    • It has several variables, depending on the stage of implementation
      • A bool, isRunning. True when the levitator is running.
      • A bool, up, true if the levitator is going up.
      • A vector, startLocation, the position where it starts.
      • An int, direction, not used in the final item but a multiplyer.
    • class Levitator {
         Public:
             
             Constructor:
                  startLocation = getRelativeLocation 
                  StartLevitator()
      
             
             StartLevitator
                  if (not isRunning) 
                     isRunning = true;
                     if (up) 
                         Start Timeline forward
                     else
                         start Timeline reverse
      
             
             On Timeline Tick
                 SetRelativeLocation = StartLocation + LERP(bottom, top, timelineAlpha);
             
             On EndTimeline
                 isRunning = false;
                 up = not up;
                 delay 3 seconds
                 StartLevitator();
      
         private
              bool isRunning = false;
              bool up = true;
              int direction = 1;
              vector startLocation
      }
              
  • Lerp : $ f(\alpha) = S*(1-\alpha) + E\alpha$