Position after change scene

AldoAldo Member Posts: 53
edited November -1 in Working with GS (Mac)
Hi!
How I can load my last position after a change of the scene?
For example: My 1st actor collides with a 2nd actor[door](he changes the scene from 1 to 2). When I collide with a 3rd actor[door](he also changes the scene from 2 to 1), I return to the initial position. How to configure a position of the 1st actor that looks like he's just exited from 2nd actor[door]?
Regards

Comments

  • QbAnYtOQbAnYtO Member Posts: 523
    Try using attributes. Do u know how to use attributes?
  • AldoAldo Member Posts: 53
    QbAnYtO said:
    Try using attributes. Do u know how to use attributes?

    Yup, I thought that I use self.position X & Y of this actor, but I found the data of that position was from the start of the game.
    If I enter any data for x & y, my actor cannot move. ;(
    Any ideas?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Make 2 attributes call them player x and player y or whatever you want. Have them set to the starting x and y positions in actor 1. In the actor 1 have a 2 change attribute behaviors change self position x to player x and self position y to player y. Then have a rule when overlaps with door change attribues player x to self position x, and player y to self position y.

    That will make it so when you start the game it starts where you want it, becase the player x and player y attributes you made are at the starting point. Then when you go threw the door, they update to the last position before changing scenes. Then when you go back to it it starts from where it left off, because player x and player y changed to the last position, then loaded with the 2 change attribute behaviors that are standing alone as soon as the scene starts.
  • AldoAldo Member Posts: 53
    JohnPapiomitis said:
    Make 2 attributes call them player x and player y or whatever you want. Have them set to the starting x and y positions in actor 1. In the actor 1 have a 2 change attribute behaviors change self position x to player x and self position y to player y. Then have a rule when overlaps with door change attribues player x to self position x, and player y to self position y.

    That will make it so when you start the game it starts where you want it, becase the player x and player y attributes you made are at the starting point. Then when you go threw the door, they update to the last position before changing scenes. Then when you go back to it it starts from where it left off, because player x and player y changed to the last position, then loaded with the 2 change attribute behaviors that are standing alone as soon as the scene starts.

    work!!! :D:D:D
    thx!
Sign In or Register to comment.