Add Loop using attribute?

codematescodemates Member Posts: 112
edited November -1 in Working with GS (Mac)
Is it possible to change the loop attribute using another attribute?

For example I want to have an on/off button that will checked first if the sound I want to play will loop or not.

Thanks

Comments

  • codematescodemates Member Posts: 112
    Hi Tshirtbooth, I got that part. I think my problem is still trying to learn where I should place the rules. I was thinking that the rule had to be put on the sound itself. Anyways, thanks for your patience.

    I do have a follow up question... Any idea why I got this to work but for some reason it will only loop if I press and hold on the key. I have Actor received event -> Touch -> Pressed selected. When I press on the button it plays the sound but when I enable the loop I have to hold the button to have a continuous loop.

    Any idea?

    Here's a screenshot of my rules
    http://www.codemates.com/temp/button_press.tiff

    Thanks!
  • codematescodemates Member Posts: 112
    tshirtbooth said:
    yep because you have a rule that says when touch is pressed when its no longer press it will not loop.

    you need to make a trigger

    when game.loop = 1 then loop when it = 2 play but dont loop and then when you want to stop it change it to 0

    hope that helps

    cheers

    Slow but surely... I finally figured out what you meant by setting up triggers. Not sure if the most optimal way of doing it but it's doing what I wanted it to do :) Thanks for your help!

    Here's the Rules:
    http://www.codemates.com/temp/Play-Loop-Trigger.tiff

    I'm still interested on hiring you for the other issue I have. Please check your PM here.

    Thanks
Sign In or Register to comment.