Click !!!!!!

Maybe i am meMaybe i am me Member Posts: 25

Ty for coming

I have 2 Actor ill call Ac1 and Ac2 . It place in same position.

so when i click in Ac1 ,,, Ac2 will be action too .

I need action in Ac1 only . How can i do that.

btw. Ac1 and Ac2 also have different action. (action mean Rule in itself)

Comments

  • IceboxIcebox Member Posts: 1,485

    I think it will depend on your game , when do you want the touch to trigger on actor 2 ?

    if actor 1 will change its position then you can put a rule in actor 2

    if overlaps or collides with actor 1
    do nothing ( leave it blank)
    otherwise if touch is pressed
    do something.

    So actor 2 will only trigger if its touched and its not overlapped with actor 1

    But if they will remain in the same position the whole game , and you want one of them to trigger , you can add a game attribute and change it depending on when you want the actions to trigger. For example
    create a game boolean attribute game.XX set it to true

    In actor 1
    if game.XX is true
    if touch is pressed do something

    In actor 2
    if game.XX is false
    if touch is pressed do something

    Now depending on when you want to chose which actor , toggle game.XX true or false.

    The logic can change depending on your game , you might not even need to do it this way. I can't look into your game so its hard to decide which approach is best , there are many other ways to do it as well, but these are 2 simple ways that might help.

  • Maybe i am meMaybe i am me Member Posts: 25

    ill try thank you so much

  • Maybe i am meMaybe i am me Member Posts: 25

    @Icebox said:
    I think it will depend on your game , when do you want the touch to trigger on actor 2 ?

    if actor 1 will change its position then you can put a rule in actor 2

    if overlaps or collides with actor 1
    do nothing ( leave it blank)
    otherwise if touch is pressed
    do something.

    So actor 2 will only trigger if its touched and its not overlapped with actor 1

    But if they will remain in the same position the whole game , and you want one of them to trigger , you can add a game attribute and change it depending on when you want the actions to trigger. For example
    create a game boolean attribute game.XX set it to true

    In actor 1
    if game.XX is true
    if touch is pressed do something

    In actor 2
    if game.XX is false
    if touch is pressed do something

    Now depending on when you want to chose which actor , toggle game.XX true or false.

    The logic can change depending on your game , you might not even need to do it this way. I can't look into your game so its hard to decide which approach is best , there are many other ways to do it as well, but these are 2 simple ways that might help.

    It's doesn't work because my Ac1 is on HUD and Ac2 is Background it not overlap another ways ?

  • IceboxIcebox Member Posts: 1,485

    I didn't understand, i thought they overlapped cause you said

    It place in same position.

    so when i click in Ac1 ,,, Ac2 will be action too .

    I just tried it in different layers , it works just fine.

    But if it doesn't then try another method , look into the video tutorial hopscotch shared , or try doing it with a game attribute

  • Maybe i am meMaybe i am me Member Posts: 25

    @Icebox can u gift me some guide template x)

  • Maybe i am meMaybe i am me Member Posts: 25

    My HUD always move for the game so i can't use constrain Att to check position and like that
    It can't overlap each other

  • IceboxIcebox Member Posts: 1,485

    @Maybe i am me said:
    @Icebox can u gift me some guide template x)

    I can but i don't really understand what you want , you have to explain in details , sorry :) Maybe someone who understands better can guide you, or show an image with steps of what you want to achieve.

Sign In or Register to comment.