attribute with animation

I'm going crazy with this problem and most likely have an easy solution but it took 2 days trying to do and not how.

I have 2 actors. Actor 1 follows actuator 2 (Hero), and I want to get one actor to another actor collide make an animation in the actuator 2. What I have done is create a boolean attribute called animation in game and say that when actor collides with one other actor change the attribute to true. Then the actuator 2 add a rule that if the animation attribute is true then do the animation and then change the animation attribute to false. What I get is that the animation is met only once and no more. Forgive my English, I hope you have understood me well and have if you can help me. thank you very much

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2013
    It sounds like your logic is correct. I would recommend placing a DisplayText actor on the scene with game.animation or whatever you called your boolean attribute so that you can watch to see if it is resetting to false correctly, and then back again to true.

    If that doesn't do the trick, consider posting a screenshot of your rules here.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tarsiustudiotarsiustudio Member Posts: 130
    Thanks @tatiang for your reply. First I did what digiste display text and worked well but the display text in the animation. It occurred to me to put a timer in the animation without touching any code and now works perfectly.

    Tell me how to send pictures and send you here as he did and did not work and now me as I do and it works with the timer. While I work and I would like to learn why not work with the rule I put above.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I have instructions in my signature for how to embed an image.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tarsiustudiotarsiustudio Member Posts: 130
    I'm sorry but I've been looking at your signature and have found nothing. I'm new to this and do not understand English very well. Thanks for everything @ tatiang
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2013
    First, you have to upload the image to a file-hosting service such as tinypic.com.

    Use this tag:

    image

    The result is below. Change the URL between the quotes for your own image.

    image

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tarsiustudiotarsiustudio Member Posts: 130
    edited December 2013
    image
    I put this image in the rule that if the actor playing the actor boca animation change the attribute to true
    image
    in this other picture I put the rule that if the attribute is true then do the animation and then change the attribute to false.


    This is what does not work and I've put a Timer in this actor and have since 0.5 seconds after making the animation and change the attribute to false and so if I work. You see something strange?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I fixed the tag for your first image. You can edit your post (for the first 24 hours). Take a look at the tag when you edit the post and you should be able to get the second image to display.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tarsiustudiotarsiustudio Member Posts: 130
    Thanks @ tatiang xD I've finally learned. See something wrong in the code so that I do not animation? sorry about all this trouble
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It's no trouble. I would still recommend using a DisplayText actor to check the value of that attribute. But try putting the Destroy Actor behavior AFTER the Change Attribute behavior and see if that helps. I always make the Destroy Actor behavior the last/lowest in any actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tarsiustudiotarsiustudio Member Posts: 130
    Nothing I have done what to put at the end and destroy anything. Fortunately, with the rule timer if I work, but will try all ways to find out what's going to be learning more about the author. Many thanks for your help
Sign In or Register to comment.