How to Auto move actor from left to right to left no stop?

bluethunderbluethunder Member Posts: 33
edited November -1 in Working with GS (Mac)
I want my actor to move left to right and to left automatically?
Thanks.

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    How so? How far? In a circle or a line? The more information you can give the better. What are you trying to accomplish?
  • bluethunderbluethunder Member Posts: 33
    Oh sorry.
    I am thinking of putting an actor at the bottom of the screen.
    The actor will move left end to right end to left end again in a straight line throughout the game.
    Just like a robot goal keeper automatically move left and right to block ball.
    Thanks for the help.
  • UtopianGamesLtdUtopianGamesLtd Member Posts: 120
    If it's a goal keeper your probably better to constrain the X or Y position (depending on view) to the Ball? You could have it lag a little so it reacts faster or slower to the X Y of the Ball.

    Or if you simply want to keep it moving left right left use interpolate.

    self.position.X to self.position+320

    If self position = 320 Interpolate 0

    Darren.
  • bluethunderbluethunder Member Posts: 33
    Problem solved.
    I created two invisible wall on both end.
    The actor will bounce from left to right to left and so forth.
    Cheers! :)
  • UtopianGamesLtdUtopianGamesLtd Member Posts: 120
    Make sure it doesn't slow down over time...depending on what you have used to move.

    Darren.
  • bluethunderbluethunder Member Posts: 33
    Thank you Utopian.
    I will definitely use your method as my method has too much flaws.
Sign In or Register to comment.