So i am very new to using Unity and not very good at scripting, but i am trying my best
Can someone tell me what the problem is with this code?
function Update ()
{
if(Input.GetKeyDown(“w”))
{
// Plays the walkinganimation - stops all other animations
{
animation.Play(“Walkinganimation” , PlayMode.StopAll);
}
}
To me it looks like you had one extra bracket after the if statement
function Update ()
{
if(Input.GetKeyDown("w"))
{
// Plays the walkinganimation - stops all other animations
// { <- this bracket wasn't needed
animation.Play("Walkinganimation" , PlayMode.StopAll);
}
}
Also use CODE tags when posting code on the forums, just for next time you post