Hi,
I’m creating a game through a tutorial, I did all the steps right but when I go to run the game gives me error in the compiler.
I reviewed the code and are all equal.
Someone help me?
PS: Sorry for my english.
` using UnityEngine; using System.Collections; public class PlayerControlo : MonoBehaviour { //Controlo Player public float speed = 8; public float acceleration = 12; private float currentSpeed; private float targetSpeed; private Vector2 amountToMove; private PlayerFisica playerFisica; // Use this for initialization void Start () { playerFisica = GetComponent.PlayerFisica(); } // Update is called once per frame void Update () { targetSpeed = Input.GetAxisRaw("Horizontal") * speed; currentSpeed = IncrementTowards(currentSpeed, targetSpeed,acceleration); amountToMove = new Vector2(currentSpeed,0); playerFisica.Move(amountToMove * Time.deltaTime); } private float IncrementTowards(float n, float target, float a){ if (n == target) { return n; } else { float dir = Mathf.Sign(target - n); n += a * Time.deltaTime * dir; return (dir == Mathf.Sign(target-n))? n: target; } } } `