How to reset only certain actors in a scene to original position?

vetievetie Member Posts: 9
edited November -1 in Working with GS (Mac)
Looked all over but cant find an answer. I have a button that will reset the entire scene with no problem.

I also need a button that ONLY resets certain actors within the scene (i.e "Reset all coins" or "Reset Blocks only").

Is it possible to only reset certain actors of a scene to the same location they were in when the scene started?

Thanks for any help

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    How are you resetting the scene? Are you using the 'reset' behaviour?

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • vetievetie Member Posts: 9
    To reset my scene, I simply added a button and chose the reset scene behavior which will reset all of my actors to the original positions.

    My scene contains both "coins" and "blocks"

    I would like a button that says " Reset coins only" and it would reset the coins to the original position but leave the blocks in the current position. (the blocks are movable in my scene)
  • quantumsheepquantumsheep Member Posts: 8,188
    the reset scene behaviour is useful for a quick reset, but you can't pick and choose *what* will be reset.

    You'll need to do it manually. Make a reset button with a boolean on it 'reset scene' - when you press the button, the reset scene boolean gets set to true.

    Then in every actor you want reset, you need to set starting XY positions, and put in a rule 'when reset scene = true' then move to starting XY positions.

    You will also have to manually change all your variables, e.g score, to their original values in the reset button.

    Hope that helps!

    QS :D

    EDIT - once you've done all that, you can make specific reset buttons - for the coins for example - so when you press a 'reset coins' button the variable resetcoins will = true and just the coins get moved (by putting the rule if resetcoins=true, move to original positions into the coin actors).

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • justpro5justpro5 Member Posts: 49
    hi mate
    I'm new here but i made this for you to rest actor to original position or for anyone who want to get benefit from it.
    the link is
    if the link is not working please open GS and serach for reset actor

    http://gamesalad.com/game/22715
  • vetievetie Member Posts: 9
    I wish to thank both quantumsheep and justpro5 for the help, this is exactly what I was looking for.

    justpro5, the example you did works great (it also gave me another idea about displaying the x and y coordinates of an actor)

    Thanks again for the great help!!
  • tiberiustiberius Member Posts: 2

    hi guys, its seems like the link doesn't lead to reset actor tutorial.

    can you please help me with this reset actor position?

Sign In or Register to comment.