**It says something about ints in error log, but i thought this worked in older unity c# correct me if i am wrong i need to get around this it is driving me mad i cannot find any links for c#, hope full using ints isn't the only way because i have no idea how to work them(error log: error CS1503: Argument `#2' cannot convert `UnityEngine.PlayMode' expression to type `int')**
thanks in advance!
public class PlayerAnimations : MonoBehaviour {
private Animator PlayerAnimator;
void Start ()
{
PlayerAnimator = GetComponent();
}
// Update is called once per frame
void Update ()
{
if (Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.LeftShift))
{
PlayerAnimator.Play("Run", PlayMode.StopAll);
PlayMode.StopAll;
}
else if (!Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.LeftShift))
{
PlayerAnimator.Play("Idle");
}
if (Input.GetKey(KeyCode.W))
{
PlayerAnimator.Play("Walk", PlayMode.StopAll);
}
}
}
↧