How can I move an actor to the FRONT on touch? Is this possible?

MotoMoto Member Posts: 33
edited November -1 in Working with GS (Mac)
I would like to know if it is possible to move an actor to the "front" of all other objects within the scene when they are touched. There would be 4-10 actors per scene and this needs to happen to any of these actors as they are touched, so Actor 1 would move to the front on touch and then Actor 2 would move in front of Actor 1 when touched, etc, etc. Is this possible?

Thanks!

Comments

  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    You need to have 2 of each actor.
    The Front one is With color Alpha 0.
    when you touch it, you change a variable to let the front now that there is a touch, and change colour alpha of the front actor to 1.

    Cheers-
  • MotoMoto Member Posts: 33
    The actors also move with touch. I could see your solution working on the first touch, but if the end user was to touch actor 1 and move it then touch actor 2 and then go back to actor 1 it would no longer move to the front because the secondary actor is already visible. Any other ideas or possible solutions to make this work?
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    You Constrain Their positions.
  • Metronome49Metronome49 Member Posts: 297
    And all the actors that need to show in the front at touch also overlap each other?
  • ChaserChaser Member Posts: 1,453
    when touch is pressed spawn the same actor in front of scene then destroy the original

    if that doesnt work do the same thing but instead of spawn the same actor in front spawn a duplicate actor same image different name at touch x and y
  • MotoMoto Member Posts: 33
    I was able to make this work with all of your help. THANKS!

    Here is what I did. I created a duplicate of the actors and then matched their position on the screen. I then changed the Color Alpha attribute to 0 and create a rule to change Color Attribute to 1 on touch and then created and "otherwise" rule to change it back to 0. This allows the touched actor to appear on top always no matter how many times you touch the multiple actors. Everyone that again for your input. The Force is Strong in all of you!
Sign In or Register to comment.