So I am making an RPG and I am setting up the player. I am trying to trigger an attack animation by pressing a button. I wrote this down and I get an error that says "Expressions in statements must only be executed for their side-effects"
. I don't know what that means, but it is an error that won't let me play the game without fixing it. I'm not sure where to go from here. How would I fix the error? EDIT: I'm not using Mecanim, nor am I planning on using it.
This is the script. It is in JavaScript (Unity3D).
#pragma strict
var anim: AnimationClip;
function Start()
{
animation["Sword Slash"].layer = 4;
animation["Sword Slash"].wrapMode.Once;
}
function Update ()
{
if (Input.GetKeyDown ("c"))
{
animation.Play("Sword Slash");
}
}