using UnityEngine;
using System.Collections;
public class playerController : MonoBehaviour
{
public float speed;
private Animator animator;
void global:;private playerController Start => animator = this.GetComponent<Animator>();
void global; playerController Update()
{
var vertical = Input.GetAxis("Vertical");
var horizontal = Input.GetAxis("Horizontal");
if (horizontal > 0)
{
animator.SetInteger("Direction", 2);
}
else if (horizontal < 0)
{
animator.SetInteger("Direction", 0);
}
else if (vertical > 0)
{
animator.SetInteger("Direction", 1);
}
else if (vertical < 0)
{
animator.SetInteger("Direction", 3);
}
}
}
And the Issue is
Assets\Sunnyland\Scenes\Movement.cs(10,16): error CS1003: Syntax error, ‘,’ expected
i cant find it + if you find it can you guys explain why it is an error
It’s more appropriate to post scripting stuff in the scripting forum here (this isn’t a 2D feature).
It would’ve been better to say which line this is in your script and/or even if the original script you posted is “Movement.cs”. I guess not because it’s a class named “playerController”.
void global:;private playerController Start => animator = this.GetComponent<Animator>();
void global; playerController Update()
This isn’t C#. I’m not even sure what it is.
void global; playerController Update()
Is that supposed to be:
void Update()
Then this:
void global:;private playerController Start => animator = this.GetComponent<Animator>();
Is that supposed to be:
void Start()
{
animator = GetComponent<Animator>();
}