Click Actor to animate problem

zzap64zzap64 Member Posts: 405
I have an Actor with approx 20 frames of animation. I wish to click on him to plat thru the animation once. The problem I have is I have to click on him to play everyframe, is there a way I can click on him once he then plays his animation until the end ?

thankyou.

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    The simplest way is to change the condition in your Rule to 'Touch is released', like this:

    Rule
    When all conditions are valid:
    Touch is released
    -----Animate
  • zzap64zzap64 Member Posts: 405
    Thanks for the feedback. The problem remains that I have to hold down the mouse button to play through the entire anim, I just want to press once and it plays through.

    Thanks
  • quantumsheepquantumsheep Member Posts: 8,188
    Try just doing:

    When touch is pressed:

    Play animation

    Was more of a CRASH man myself ;)

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I would have a boolean

    when touch is pressed
    change self.StartAnimate to 1

    Rule
    When self.StartAnimate is true
    Animate

    May need to have a second change attribute in a timer to set the boolean back to false to stop the animation and allow it to be restarted with a second click.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    If 'Touch is released' is not working, it sounds like there is a logic bug somewhere.

    Is all the code for your Actor in the prototype in the library?
    When you double-click on the button in the scene, is there a padlock there?
  • zzap64zzap64 Member Posts: 405
    I have a Rule that when an Actor receives an event touch is pressed.
    I add a Attribute rule underneath this but cannot find self.StartAnimate under the attribute browser ?
  • zzap64zzap64 Member Posts: 405
    Yeah, all the code is in the actor library, no padlock being shown.
  • zzap64zzap64 Member Posts: 405
    Hey, I started from scratch and now it works fine when touch is released, must of been a logic bug.
    thanks for all your advice.
    Just like turning a computer on/off when all else fails and everything works again :)
Sign In or Register to comment.