moving back forth and upward?

raggragg Member Posts: 65
edited November -1 in Working with GS (Mac)
hi,how to make an actor to move right and left while moving upward?i only can make it move up or back and forth...but not both at the same time..help pls..

Comments

  • raggragg Member Posts: 65
    anyone help pls?
  • raggragg Member Posts: 65
    hey guys...help please...really appreciated
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    you must use accelerate not move or change velocity.

    Here is a trick to get it to feel like move.

    RULE (ALL)

    When right key is pressed
    self.linear.X < 250 (or whatever you have been setting the move rate to)

    accelerate 0 degrees 2000 (you want this big so it gets to your desired speed instantly)

    OTHERWISE

    Change velocity to 0 relative to actor

    ---------------------------------

    RULE (ALL)

    when left is pressed
    when self.linear.X is > -250

    accelerate 1800 degrees 2000 (you want this big so it gets to your desired speed instantly)

    OTHERWISE

    Change velocity to 0 relative to actor

    These rules will feel like move, but will work while jumping or falling.
  • raggragg Member Posts: 65
    thanks for reply...but i want the actor to constantly moving back ,forth and upward itself without control....any idea?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Create a boolean attribute - MovingRight

    RULE

    When self.position.X < 20
    -change attribute game.MovingRight to true (1)

    RULE

    When self.position.X>460
    -change attribute game.movingRight to false (0)

    RULE
    moving right is true
    self.linear.X < 250 (or whatever you have been setting the move rate to)

    accelerate 0 degrees 2000

    RULE
    when moving right is false
    when self.linear.X is > -250

    accelerate 180 degrees 2000

    You can change 20 and 460 to constrain the how far left and right it moves.

    To make it move up:

    when self.linear.Y < 300 (change this to whatever speed you want)

    accelerate 90 degrees 2000
Sign In or Register to comment.