Help With Moving Bars Back And Forth

FortifyFortify Member Posts: 18

I need to move two bars back and forth while moving downward at the same time and they need to have a specific gap between the two bars. I have tried the method of making rules that are triggered when the bars x position is at a certain point and that didn't do anything, and I have tried the method of making a timer that changes an attribute every couple seconds and the two bars move based on that attribute. The second one gave me a little success but it was very glitchy, maybe moving way longer than the time set or being very jittery. Could someone please explain to me how to do this because I have tried for the past two days thing to fix it and I can't. Thanks a ton if you can help!

Comments

  • jeezzcakejeezzcake Member Posts: 144

    Constrain self.Motion.Linear Velocity.y to -100sin(self.Time300)-20

  • FortifyFortify Member Posts: 18
    edited October 2014

    @jeezzcake‌ that doesn't seem to do anything. Does it matter that the bars are moving down at the same time

  • ArmellineArmelline Member, PRO Posts: 5,366
    edited October 2014

    Constrain linear velocity.Y to -100 or whatever downward speed you want.

    Add a change attribute - change attribute "self.Start X" to self.position.X

    Add another constrain attribute, but this one for self.Position.X. Constrain it to

    sin(self.Time*100)*20+self.StartX

    The 100 is the speed it will move and the 20 is the distance. Adjust them until you have the desired effect.

    The actor should move back and forth while moving downwards. If there's more than one actor, they will maintain the same relative X and Y positions as when you place the actors.

    Sorry if that's unclear, very tired :D

  • FortifyFortify Member Posts: 18

    @Armelline‌ thanks a ton that did it

Sign In or Register to comment.