x


Animation events and synclayers

I have an animation that shoots a fireball at a given frame. I got rid of the synclayer for this animation and the event works. Unfortunately, I want to loop the animation so the user can hold the fire button and shoot fireballs until he let's go. However, once you press the fire button, the animation loops forever. Is there a way so that I can accomplish this without the use of the sync layers?

more ▼

asked May 17 '10 at 06:43 PM

Helpmepls123 gravatar image

Helpmepls123
37 4 4 9

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You can add an Animation Event on the last frame of the animation to check and see if the fire button is being held down. If it is, then tell the animation to Play() the AnimationClip again, otherwise do nothing and the animation will finish. For this to work, the AnimationClip's wrapmode should be set to either default or Once.

Cheers,

==

more ▼

answered May 17 '10 at 07:19 PM

equalsequals gravatar image

equalsequals
4.5k 16 28 64

That worked very well. Thank you :)

May 21 '10 at 01:09 AM Helpmepls123
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3806
x166
x1

asked: May 17 '10 at 06:43 PM

Seen: 1303 times

Last Updated: Jan 10 '11 at 01:29 PM