Help with Inputs and Timelines

Hello everyone, I need some help with Inputs and Timelines. What I am doing is I have a level that will spin 90 degrees when you press the “E” button when you are overlapping with the collision box of the object (Cube Blueprint) the blueprint is a part of. This part works, but once the level spins naturally the Cube Blueprint is out of reach. I am made a Trigger Volume and using the Level Blueprint I can call on the Cube Blueprint (once I am overlapping with the Trigger Volume). This also works because I got the Cube Blueprint to Reverse. What I’m having problems with is getting the level to spin 90 degrees again.

So far I have made multiple Timelines. I’m sure all I need is one Timeline with four Float Tracks, but I have no idea how to make one Float Track play after the last is finished. Here is a screenshot of what I have so far.

As you can see I have two Timelines, 1 goes from 0 to -90 degrees and the other goes from -90 to -180. I am trying to toggle the first one and then the second one once the “E” button is pressed again. The “Switch on EIntTypes” will only play one and only one, so I have no idea why there are multiple Int nodes. It is the same with “Switch on Int” and “Switch on EFloatTypes”. I am so close to getting this to work I can feel it, so I am asking if anyone can help me out here.

I really miss the Toggle from UDK.

Here your “SwitchOnEIntTypes” is waiting for an input and will trigger its branch corresponding to that input.

The input you’re currently passing is “int” so it will always follow the branch “int”, playing your first timeline over and over.

I’m not sure what you’re trying to achieve, as I understand it you want the E button to trigger the first timeline, then the second one, then do nothing? Or loop back to timeline one?

If you just want to do the former, a simple trick would do:

E input -> Flip Flop ->
A) -> DoOnce -> Timeline 1
B) -> DoOnce -> Timeline 2

It’s not the cleanest way to do it but it will get you started I believe.

Have a good day :slight_smile:

You should use SwitchOnInt instead and feed that an int variable. After the timeline increase the int value by 1 so the next time you press E it will trigger the next execution output.

Ok so what you see here is half of what I’m trying to do. I want to hit the “E” button to play Timeline 1 (which makes the level spin 90 degrees), when the “E” Button is pressed again it will play Timeline 2 (making the level spin another 90 degrees, so spinning 180 degrees altogether). I would continue to do that until the level has spun a full 360 degrees. This means using 4 Timelines and with each button press the level will spin 90 degrees. I will try the Flip Flop trick.

Then do the following steps:

  • Create an Int variable CurrentTimeline - BaseValue = 0
  • OnInput -> Increment *CurrentTimeline *(if > 4, set to 1, or more simply clamp to 1/4)
  • Then Get CurrentTimeline, drag a wire from it and SwitchOnInt, this will give you a Switch with several outputs (Default - 0, 1 I believe) you can add as many as you want (I believe you want to go up to 4, one for each Timeline, from 1 to 4)
  • Wire each of your timeline to each outputs of the switch