Hello I need help to solve this script I do not know how to solve it because it tells me that it has (839057)

[código = CSharp] usando System.Collections;
usando System.Collections.Generic;
usando UnityEngine;

clase pública SpawnObject: MonoBehaviour
{

public GameObject Foodprefab;

centro público Vector3;
tamaño público de Vector3;

// Use esto para la inicialización
inicio vacío ()
{

SpawnFood ();

}

// La actualización se llama una vez por fotograma
Void Update ()
{
si (Input.GetKey (KeyCode.Q))
SpawnFood ();

}

public void SpawnFood ()
{

Vector3 pos = centro + nuevo Vector3 (Random.range (-size.x / 2, size.x / 2) Random.range (-size.y / 2, size.z / 2));

Instanciar (Foodprefab, pos, Quaternion.identity);
}

void onDrawGizmosSelected ()
{
Gizmos.color = nuevo Color (1, 0, 0, 0.5f);
Gizmos.DrawCube (centro, tamaño);

}

}
[/código]

Line 34 is this one:

Vector3 pos = centro + nuevo Vector3 (Random.range (-size.x / 2, size.x / 2) Random.range (-size.y / 2, size.z / 2));

However, no idea why your entire code is in portuguese (? correct me if I’m wrong! ^^). Plus points for using Code tags, though they don’t work because of that.

I do not speak Portuguese without Spanish and it seems that there was a mistake to the momete of publishing the script I am going to publish it again

This isn’t going to work… you cannot localize the keyword if into the word si

At least I don’t think you can.

These also will fail:

And I doubt you can use non-ascii characters in variable identifiers:

Gizmos.DrawCube (centro, tamaño);

Keep it all ASCII otherwise you’re going to have issues. Same goes for filenames.

Also put a comma after the Random.range(-size.x / 2, size.x / 2).