Hi ! first, sorry for my english, i’m not very good …
I’m a very beginner on Unity.
So, I want detect how fast my character is moving, and then fade between the walk and idle animations. I have already correct a lot of error but i don’t succed to correct this. I’ve seen lot of post of people who have this error but i don’t understand this mistake…
When i push play, it make an error: Assets/animation courirpose.js(3,28): BCE0043: Unexpected token: …
#pragma strict
function Update(UnityEngine.Animation){
if (Input.GetAxis("Vertical") > 0.2)
Animation("walk");
else
Animation("idle");
}
Hey there. I am not exactly sure how JavaScript works with Unity, and If I say something dumb please Ignore this post, but I think that the Update function should not have that “UnityEngine.Animation”. Give it a try
CloudKid Hey, thanks for your quick reply … yes but when i change the Update function for another thing, a new error appears:
Assets/animations walk.js(5,26): BCE0024: The type ‘UnityEngine.Animation’ does not have a visible constructor that matches the argument list ‘(String)’.
Oh yeah, I didn’t see that. You can’t use Animator class like that… ( Animation(“walk”)
You should look for some Unity JavaScript programming tutorial, as I see you have no idea what you are doing.