I'm creating a game based on a video on youtube ... And in this video has a link to the site with the codes, I copied the codes and pasted exactly as it was then to modify and do it my way ... But it's giving Unity errors that I can not solve!
The error occurs in the code of class Dinheiro
:
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;
}
}
The error message is A new expression requires () or [] after type
and the compiler indicates line 14, where there is the command transform.position = new Vector3(...
, as shown below: