How to make a character follow your touch?

gamesaladpowergamesaladpower Member Posts: 2
edited November -1 in Working with GS (Mac)
I'm making my first game for the iPhone and was wondering how to make my character follow my touch on the screen. Thanks so much!

Comments

  • svnsvn Member Posts: 445
    All right gamesaladpower, here's what you do: In your character's Actor Editor, create a rule: When: touch is pressed:
    Now, drag two Constrain Attribute Behaviors into the rule: Constrain Attribute: self.Position.X to Devices.Touch1.X
    and
    Constrain Attribute: self.Position.Y to Devices.Touch1.Y

    I think this'll do the trick.

    Good luck on your project.
  • gamesaladpowergamesaladpower Member Posts: 2
    Thanks a lot! I'll post my game once it's done ^_^
  • SenshaijSenshaij Member Posts: 7
    RKS: I think the difference is what platform you're making it for.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Like RKS said, I dont think it will work quite the same way if you use touch position. Use Mouse Position X and Y. It should work a lot better.

    Just my experience. :-)
Sign In or Register to comment.