Move To in only 1 dimension

ShaunEleryShaunElery Member, PRO Posts: 148
I'm making a forced scrolling game. How can I make the actor Move To certin points in the Y dimention only, but keep moving horizontaly at a constant rate? The Move To behaviour wants something in the X field.

thank you

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    I'm making a forced scrolling game. How can I make the actor Move To certin points in the Y dimention only, but keep moving horizontaly at a constant rate? The Move To behaviour wants something in the X field.

    thank you
    Move X to self.position X
    Move Y to where you want move to in the Y dimension.
  • ShaunEleryShaunElery Member, PRO Posts: 148
    I have that and a Move right at speed of 300 and it only moves right. It does not obey the Move To behaviour. Should i use something else to make the Actor constantly move right?
  • ShaunEleryShaunElery Member, PRO Posts: 148
    Or would it be best to make everything else move left, so it only appears to the player like the actor is moving right?
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    I have that . . . .
    Have what ?
  • ShaunEleryShaunElery Member, PRO Posts: 148
    Sorry. I have Move X to self.position X
    Move Y to where you want move to in the Y dimension like you said. It works until I add the Move right behaviour.
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    Sorry. I have Move X to self.position X
    Move Y to where you want move to in the Y dimension like you said. It works until I add the Move right behaviour.
    You have 2 move behaviours being implemented at the same time - and you would like both to work, is that basically what you are after ?
  • ShaunEleryShaunElery Member, PRO Posts: 148
    I need my actor to move to the right at a constant rate no matter what his Y position is. But I also need to move to specific Y positions without interrupting the X movement.

    I have a Move behavior for the horizontal motion and a Move To behavior so the actor will reach the specific Y points. But only one works at a time.
  • SocksSocks London, UK.Member Posts: 12,822
    I have a Move behavior for the horizontal motion and a Move To behavior so the actor will reach the specific Y points. But only one works at a time.
    Can you take a screen shot of your code and post it here?
  • ShaunEleryShaunElery Member, PRO Posts: 148
    I can’t screen shot because I’m at work.

    But I found a way to do it. I created an invisible actor that pushes my hero to the right by collision. Then I used Move TO for the Y position on my character and it works.
Sign In or Register to comment.