Error CS1526 & CS8032 [closed]

4

By the translation of the error says that I have to put a ")" at the end of the "type" but already  there is a ")" at the end of the "type" already tried to change to "[]" but it did not work I tried to put 2 ")" as I saw in other codes but also did not work

  

Assets / Scripts / Money.cs (14,71): error CS1526: A new expression requires () or [] after type

The second error did not try anything.

  

Assets / Scripts / Money.cs (14,93): error CS8032: Internal compiler error during parsing, Run with -v for details

the code:

using UnityEngine;
using System.Collections;

public class Dinheiro : MonoBehaviour {

    public Vector2 velocity = new Vector2(0, -4);
    public Vector3 velocity3D = new Vector3(0, -4, 0);
    public float range = 4;

    // Use this for initialization
    void Start () {

        //rigidbody2D.velocity = velocity;
        transform.position = new Vector3(transform.position.x – range * Random.value, transform.position.y , transform.position.z);

    }



    // Update is called once per frame
    void Update () {
        transform.position += velocity3D * Time.deltaTime;
    }

}
    
asked by anonymous 11.04.2016 / 23:27

1 answer

2

Initially it seems all right, but I noticed that the minus sign of the expression "transform.position.x - range" is a bit larger, I used the link ( link ) and it actually indicated an error in this signal as an unexpected character. And because of this he expects an open parentheses from the constructor, correct that character with the '-' sure that should work fine!

Look at the comparison:

transform.position.x – range //Seu sinal de menos
transform.position.x - range //Sinal de menos correto
    
31.08.2016 / 22:17