actor move to specific fixed area

hi everyone. i have an area actor. i want my player actor to move to the area (player actor on pressed) and overlap with the area. the problem here is, my player actor is not placed fix inside the box area. when i click the top area of the area actor, the player is placed too top and outside of boundary. how can i make the player place at the center of the area box?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2016

    Make two attributes that are type "real" and call them game.areaX and game.areaY.

    Area actor rules:
    When touch is released
         Change attribute game.areaX to self.Position.X
         Change attribute game.areaY to self.Position.Y

    Player actor rules:
    When [some condition]
         Change self.Position.X to game.areaX
         Change self.Position.Y to game.areaY

    I didn't understand if you were supposed to click on the area or the player to move the player...?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • barbaraaaaaabarbaraaaaaa Member Posts: 11

    i want to click the player and the player automatically move to the area. i'm sorry i'm very new to this

  • barbaraaaaaabarbaraaaaaa Member Posts: 11

    i have it works now. Thank you :)

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You're welcome.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.