Moving platform

NeverbeNeverbe Member Posts: 117
edited November -1 in Working with GS (Mac)
I'm trying to move a platform from right to left (like in some platform game) i set the linear velocity x to 50, i had create a rule to detect when the self.Position.X of the actor is equal to self.Position.X+20 change the self.Motion.Linear.X to -self.Motion.Linear.X and another rule to detect when self.Position.X of the actor is equal to self.Position.X-20 then it change self.Motion.Linear.X to -self.Motion.Linear.X but it don't want to work...anyone could help me?

Comments

  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    First Change Velocity to Some Direction, For Example Right
    Then Create a Timer Every (Time you want)
    Change Attribute: Self.Motion, Liear X to -self.motion.Linear X

    And Done..
    +Hope It helps, it works for me.
  • bladeolsonbladeolson Member Posts: 295
    you could also try using interpolation on the X position , that is how I generally do a moving object
  • NeverbeNeverbe Member Posts: 117
    MagoNicolas said:
    First Change Velocity to Some Direction, For Example Right
    Then Create a Timer Every (Time you want)
    Change Attribute: Self.Motion, Liear X to -self.motion.Linear X

    And Done..
    +Hope It helps, it works for me.

    I manage to do it!! Thanks a lot!
Sign In or Register to comment.