|
I'm making a script for the asset store and I'm almost done, this is my last bug! Anyways it will allow players to climb up and down ladders. I'm stuck on animation though. What I'm trying to do is to play the climb animation play backwards via script so the player doesn't need to make two different animations. Here's my progress:
var climbAnimation : AnimationClip;
var climbAnimationBack : AnimationClip;
function Start () {
climbAnimationBack = climbAnimation;
animation["climbAnimationBack"].speed = -1;
}
However I get this error message: "NullReferanceExeption", and when I go back to the code the line it says I have a problem with is this part: animation["climbAnimationBack"].speed = -1; Is this because "climbAnimationBack" isn't an actual animation clip, just a variable? If so how do I fix it? Thanks! P.S. I used splitting for my animations
(comments are locked)
|
Let's step through this code:
If you're getting a null reference exception, that implies one of two things:
Now, it's important to distinguish two things:
They do very different things, and don't necessarily have anything to do with each other, so it's important to keep them straight. If I had to guess, you might have meant to use In any case, it looks to me like you're trying to do one of two things:
Thanks I got it now!
Apr 11 '12 at 02:11 AM
Posly
(comments are locked)
|
