x


Animation CrossFade not working

I re-read the Character Animation guide and I simply fail to understand why my script isn't working!

Activate is called every frame when the mouse is down, and deactivate is called every frame when the mouse is up...

function Activate() {
if (!animation.IsPlaying("activate"))
    {
    animation.CrossFade("activate");
    }
triggerThis.Activate(); //a check to see if the function calls
}

function Deactivate() {
if (!animation.IsPlaying("deactivate"))
    {
    animation.CrossFade("deactivate");
    }
triggerThis.Deactivate(); 
}

Both "activate" and "deactivate" are animations in my Animation pane for the object.

Animations
    Size:     2
    Element 0:activate
    Element 1:deactivate

My script should theoretically check if its respective animation is playing. If it's not, play the animation. If it is playing, ignore it.

When I run the game, and click, the Activate script is run, but there's no animation!

Can anyone shed some light on this for me?

Thank you!

more ▼

asked Jan 30 '10 at 06:36 AM

Peter B-B gravatar image

Peter B-B
236 13 15 21

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

1 answer: sort voted first

Replacing CrossFade with Play worked

Peter

more ▼

answered Jan 30 '10 at 05:37 PM

Peter B-B gravatar image

Peter B-B
236 13 15 21

(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:

x3776
x82

asked: Jan 30 '10 at 06:36 AM

Seen: 2507 times

Last Updated: Feb 15 '10 at 04:03 PM