Animation wont run on event

0 favourites
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi and another (maybe stupid question ^^),

    i?ve created an emitter effect Animation with ParticleIllusion (output as png, 140 frames) and insert it as sprite animation into C2 (named the sprite as "buttonEffect" and the anim named as "effectAnim").

    now i?ve create a event on a button (Button named as B1)

    and create the following Actions:

    If Cursor over B1 then:

    • buttonEffect: Set animation to "effectAnim" (play from beginning)

    if i mouse over the button now... the animation wont play (zOrder for the animation is top)

    so i?ve tried to insert another Action:

    • buttonEffect: Start animation from the beginning

    and same here... no working animation.

    Anything what i?ve forgot? Any Ideas?

    Luzi

  • It should work - did example of that but only with 12 frames sprite.

    btw i think 140 frames for a sprite animation is abit to many:)

  • hmm is ther a limit for the framecount? i mean.. the complete anim has less than 80kb (all frames counted)..

    [EDITH says:]

    Okay.. now i?ve cropped the Anim to 14 frames..

    The first frame is still visible.. and if i release the Event.. the anim still not play.. -.-

    Additional Info:

    at the event .. theres another anim inside.. they will play without problems.. so the event triggers two Animations.. but only one plays..

    [/EDITH]

  • hard to say, could you post your project file? be easier to help

  • Sorry but i can?t publish the Project atm..

    but i can publish some screens...

    Event Screen:

    <img src="http://www.raccooncastle.net/devel/event_screen.png" border="0" />

    EditorScreen:

    <img src="http://www.raccooncastle.net/devel/editor1.png" border="0" />

    Sprite Screen:

    <img src="http://www.raccooncastle.net/devel/editor2.png" border="0" />

  • Okay.. i?ve created a Workaround... Still dirty but it works for the moment..

    I?ve created another Animation inside the Sprite named effectNone with an empty Frame..

    At layoutstart the sprite will use the "effectNone" Animation.

    On trigger the "Mouse Over", the Event switch the Sprite Animation to effectAnim with the 140 frames..

    and on event "mouse out" the Sprite Anim sets back to "effectNone".

    (But i hope to change this later to the right way if it works sometimes ;) )

  • Instead of "Start animation from beginning" did you try "Set animation to "effectAnim" (play from beginning)" on effect sprite.

  • Yeah, I'm always using "Set animation to "animation name" (play from beginning)" for sprites with only one animation and as far as I remember "Start animation from beginning" works only after you have stoped animation in events - but can be wrong.

  • yepp.. that works only for me if i?ve 2 animations inside the sprite..

    with one animation it wont work.

    (see my last post here in this thread)

  • lol .. double post action :D

    i?ve stopped all effect animations in the Event "System -> On start of layout" (not shown on the screenshots).. but it does not worked too..

    [EDITH says:]

    i?ve tried it again.. Stopped Anim at the "on start of layout" event..

    and start the animation inside the "mouse over" event..

    (Start Animation from the beginning... and the 2nd test "Set animation to "effectAnim" (start from the beginning)

    now the animation starts if i leave the event trigger area (so the mouse over evnt isnt triggered anymore)

    and if i trigger the "mouse over" again.. the anim stops ..

    weired.. -.-

  • 'Mouse is over object' runs every tick (about 60 times per second) while the condition is true.

    If in the event you start the animation from beginning, then every single tick while the mouse is over the object, it is rewinding the animation back to the first frame. So it never gets the chance to go to the second frame or beyond.

    Try adding a 'trigger once' condition after the 'mouse is over object' condition.

  • U�re my hero :)

    now the 2nd animation works without problems.. thx man :)

  • That's strange Ashley. I just double checked my project and it always plays the animations as they are - from beginning to the end - with "Mouse is over object". When i move mouse over sprite it starts the animation and plays it once from first frame to the last one (if loop is set to No) and repeats entire animation sequence if loop is set to Yes.

    Never had that situation with "Mouse is over object" and rewinding the animation back to the first frame.

  • Do you have other conditions in the event or did you set 'play from current frame'? If so, it won't be rewinding every tick.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • One sprite, mouse object and one event

    +Mouse: Cursor is over "Door"

    -> Door: Set animation to "Open" (play from beginning"

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)