Animations overlapping one another
Toecutter
Member Posts: 19
The main actor in my game has an idle 8 frame animation running at 12 fps. When another actor comes into contact with it an event happens causing a new 12 frame animation (running at 12fps) to play for 3 seconds. My problem is its trying to show both animations at the same time causing flickering. How do I stop the idle animation, let the new event animation play out and then return back to the idle animation? Thanks
Things are currently setup a follows:
Idle Animate (loop ticked, Restore actor ticked)
EVENT RULE
If actor collides with event actor
TIMER
For 3 seconds run to completion
Constrain Attribute (to stop my actor from moving)
Animate (12 frame event, loop ticked, Restore actor ticked)
Otherwise:
Idle Animate (loop ticked, Restore actor ticked)
Things are currently setup a follows:
Idle Animate (loop ticked, Restore actor ticked)
EVENT RULE
If actor collides with event actor
TIMER
For 3 seconds run to completion
Constrain Attribute (to stop my actor from moving)
Animate (12 frame event, loop ticked, Restore actor ticked)
Otherwise:
Idle Animate (loop ticked, Restore actor ticked)
Best Answer
-
MotherHoose Posts: 2,456@Toecutter … eliminate the 1st animateBehavior … as it is always active
and, you already have this behavior in the Otherwise: section of your eventRule
though I can see why the Timer behavior is causing problems
as the computer has no idea when to start doing animation1 again
and when that collision persists … animation1 will never be triggered
so the eventTriggering actor should be destroyed after 3 seconds
Rule: when
Event: overlaps or collides with actor of type idleActor
-Timer After: 3 seconds
--destroyBehavior
on idleActor:
Rule: when
Event: overlaps or collides with actor of type eventActor
-Animation2
Otherwise:
Animation1
MH
Answers
https://www.dropbox.com/sh/60a9diedl5sm243/IS1-Kg14lZ
The 3rd actor is to show what animation should be displayed when actor 1 collides with actor 2.