I can click an actor through an actor?

Hello Everyone,

Some helped needed. I'm trying to make a purchased page and its kind complicated to explain but let me try (I have made a video to help me explain).

I made it so the actor under the grey transparent actor is clickable and will change the background. In order to change the background you must purchase the background with the in-game currency. Once you purchase the background the grey transparent actor will be destroyed and it will be available in the purchase section. When you click it, it will change your background. But even when the actor is over the button and I click it the button the background changes. Isn't the actor over the button suppose to make the button underneath un-clickable? If not what is another way to do this because I have seen others do this too. P.S I have already sent the button to backward and sent it to back. Also I have sent the transparent cover to forward and also have sent it to front.

Thanks
Faraaz

Heres the video:
https://youtube.com/watch?v=kFlRFNwZyHw&feature=youtu.be

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    @foofooarmy@gmail.com‌ -- the logic is a bit more complicated than that. Actors are evaluated from the bottom layer up. But within an actor the behaviors are read from the top down. So, the bottom actor is receiving the touch event before the top actor has any time to do anything about it.

    Attached is a file that might help. The basic idea is that you need to slow down the bottom actor's actions by a very short timer so that the top actor can register that it has been clicked first.

  • @RThurman said:
    foofooarmy@gmail.com‌ -- the logic is a bit more complicated than that. Actors are evaluated from the bottom layer up. But within an actor the behaviors are read from the top down. So, the bottom actor is receiving the touch event before the top actor has any time to do anything about it.

    Attached is a file that might help. The basic idea is that you need to slow down the bottom actor's actions by a very short timer so that the top actor can register that it has been clicked first.

    Thanks! I will try this indeed.

  • foofooarmy@gmail.comfoofooarmy@gmail.com Member Posts: 49
    edited August 2014

    @RThurman said:
    foofooarmy@gmail.com‌ -- the logic is a bit more complicated than that. Actors are evaluated from the bottom layer up. But within an actor the behaviors are read from the top down. So, the bottom actor is receiving the touch event before the top actor has any time to do anything about it.

    Attached is a file that might help. The basic idea is that you need to slow down the bottom actor's actions by a very short timer so that the top actor can register that it has been clicked first.

    Did not work. Can you tell me what rules to add and what behaviors to add to the project because I cant get it to be delayed

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    edited August 2014

    Do you mean the demo I sent didn't work?

    Or do you mean that you could not get the logic from the demo to work in your game?

    The demo shows you "what rules to add and what behaviors to add to the project". Sorry, but I am not sure what else to tell you.

  • @RThurman said:
    Do you mean the demo I sent didn't work?

    Or do you mean that you could not get the logic from the demo to work in your game?

    The demo shows you "what rules to add and what behaviors to add to the project". Sorry, but I am not sure what else to tell you.

    I added the timer to the actor but I can still click through it. Can you explain what behaviors I need to put in because I am getting very confused. So basically I added the timer to the bottom layer but it still does not work. If its not a problem can you please watch the video and tell me what behaviors to have.

    Thanks

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    I did look at the video. Then I made the demo for you.

    What you need to learn about working with layered actors is there. If you study the demo carefully you will see how to make it work for you. (Hint: Its more than just adding a timer. But not much more!)

    Try modifying the demo. Take stuff away to see what is necessary. Add stuff to see whats not essential. The more you learn about the principle of working with layered actors, the better you will get!

  • @RThurman said:
    I did look at the video. Then I made the demo for you.

    What you need to learn about working with layered actors is there. If you study the demo carefully you will see how to make it work for you. (Hint: Its more than just adding a timer. But not much more!)

    Try modifying the demo. Take stuff away to see what is necessary. Add stuff to see whats not essential. The more you learn about the principle of working with layered actors, the better you will get!

    These words are words of wisdom. Thank you so much this fixed my problem.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    @foofooarmy@gmail.com‌ Alright! Way to go! I knew you could do it!

    The principle thing to remember is that actors are evaluated from the bottom layer up, and (within an actor) behaviors are evaluated from the top down. This sets up a paradox where the bottom actor might go through all its behaviors before the top actor gets a chance to do anything. (Even though it seems like the top actor should be 'absorbing' the mouse event first.)

    The rest is logic.

Sign In or Register to comment.