- Home /
This question was
closed Sep 21, 2013 at 08:18 AM by
Fattie for the following reason:
The question is answered, right answer was accepted
Question by
knuckles209cp · Sep 21, 2013 at 07:49 AM ·
found
Expecting : found "="
YES IM NEW AT SCRIPTING OK....
public var isSprinting : boolean = false;
public var sprintAnime : Animation;
public var sprintString : String;
function Start ()
{
sprintString = sprintAnime;
}
function Update()
{
if(Input.GetButtonDown("sprint"));
{
isSprinting = true;
animation.Play("sprintUMP");
}
else
{
if(Input.GetButtonUp("sprint"));
{
isSprinting = false;
animation.Stop("sprintUMP");
}
}
}
Comment
Best Answer
Answer by DaveA · Sep 21, 2013 at 07:55 AM
Don't put ; at the end of 'if' lines:
if(Input.GetButtonDown("sprint"));
should be
if(Input.GetButtonDown("sprint"))