Download

Setting Elevator Height in Blueprints

Hi,

I’m just learning Blueprints and I’ve been setting myself small goals to achieve each day. Today’s goal was to make an elevator that would go up to another floor when I pushed the button.
On Click-event, transform Z world location, timeline with new Z location, bam. Flip Flop and everything.

It’s a very basic idea of an elevator, and I realized that if I want to use the same blueprint for other elevators, I’d have to somehow go into the blueprint and change the timeline value, but that would interact with all elevators, no matter how far that specific elevator shaft is.
So my new problem is that I’d want a visible variable (float, I presume?) that I can set on each version of the elevator, with the appropriate Z-location it should arrive at. But I can’t figure out how to input that in the timeline - which I need if I want the animation to be smooth, right?

Any suggestions are appreciated - and I’ve no doubt there is a very simple solution to this that I just haven’t thought of!

Here is how I’ve set it up. My first version had a boolean to check if it was above Z 0, but I figured a Flip Flop was an easier way to achieve the same result.
And the ElevatorRise is 5 seconds long with auto-smoothing and an end value of 717, which is the elevator I’ve made now.

For a reusable timeline you should make the value 0-1 then modulate the result of that with a Lerp node. Lerp takes a value between 0 and 1 then outputs another value within a range you specify.

Capture.PNG

The 0-1 value from the timeline goes into Alpha, then your start Z position is in A and your Ending Z position is in B. That’s it!

Alternatively, you can use iTween and skip the timeline node. Just plug in your values and tell it how long it should take and it’ll work.