Announcement

Collapse
No announcement yet.

Trigger an Array of Relative Location Changes in sequencial order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trigger an Array of Relative Location Changes in sequencial order

    Hello!

    I need some help setting up a Blueprint Class that will allow me to animate a change in Relative Location on an actor within the Blueprint using a Timeline Node. However I would like the changes in location to be an array of variable position values (managed through an integer array) and executed one by one in a sequence using a Keyboard Pressed Trigger.

    As an example if you apply this to an elevator:

    1. Press the F - Key and the elevator would animate a change in Z position to a new floor position (0)
    2. Press the F - Key again and the elevator moves to the next floor position (1)
    3. Press the F - Key again and the elevator again to the next floor position (2)
    4. Press the F - Key one last time and the elevator moves back to floor position (0) as the Integer array only contains 3 array elements and loop from there

    Ultimately I will need the number of array elements to be variable, the values of those array elements to be variables that drive the Z position of the elevator changes, and one timeline node receiving the array values to cycle through the position changes.

    Attached is my basic keyboard driven elevator location change with only one value which I think I can add the array to? Thanks in advance for anyone who can help me achieve this.

    Tello

    #2
    Here it's.

    The components and the variables:

    Click image for larger version

Name:	0_1.png
Views:	22
Size:	41.3 KB
ID:	1473101Click image for larger version

Name:	0_2.png
Views:	26
Size:	24.4 KB
ID:	1473102

    Note, that "Positions" is an array of floats, representing the relative z distance between the ground and the level.


    The BP:

    Click image for larger version

Name:	solution.png
Views:	30
Size:	216.5 KB
ID:	1473099

    And finally the timeline:

    Click image for larger version

Name:	timeline.png
Views:	22
Size:	40.8 KB
ID:	1473100

    "I have harnessed the shadows that stride from world to world to sow death and madness."

    Comment


      #3
      EvilCleric - thanks so much for the breakdown! I will try to set this up tonight.

      Comment


        #4
        @EvilCleric - This worked perfectly!

        One question: Is the Speed Float meant to adjust the keyframe position on the timeline or is that Speed node unrelated to the speed of the platform transitions?I have the Speed Instance Editable, however adjusting the value does'nt seem to affect the timeline or speed between transitions.

        Thanks again, this is very much appreciated.

        Tello

        Comment


          #5
          Yes, you're right. My bad. I did it in a rush and didn't test it right.
          The problem of using a timeline is that no matter the distance, it will always take x seconds (in this case 1s).

          As soon as I have time, I'll try to correct it. So, for now you can remove that part:

          Click image for larger version

Name:	image_137357.png
Views:	24
Size:	199.5 KB
ID:	1473563
          Last edited by EvilCleric; 05-09-2018, 02:24 PM.
          "I have harnessed the shadows that stride from world to world to sow death and madness."

          Comment


            #6
            Ok Swelllog here is the correction. It end up a little big but now it works as it should be.
            If you have 3 floors and if it takes 2s between consecutive floors, now it will take 6s to go from floor 3 to floor 0.

            Check the new "Set Play Rate" nodes before the timeline:

            Click image for larger version  Name:	corrected.png Views:	1 Size:	366.3 KB ID:	1473582

            Note that for normal speed (1 second between consecutive floors) => Speed = 1.0
            For double the speed (0.5s) => Speed = 0.5
            For half the speed (2s) => Speed = 2.0
            Last edited by EvilCleric; 05-09-2018, 03:25 PM.
            "I have harnessed the shadows that stride from world to world to sow death and madness."

            Comment

            Working...
            X