error

What is the error? the number is CS1525

He says :
Assets/Scripts/personaje.cs(55,12): error CS1525: Unexpected symbol `void’

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class personaje : MonoBehaviour
{

public string playerName = “Andriu”;

public string playerHeight = “UnMetroSetenta”;

public int playerSpeed = 3;

public int playerLife = 10;

public int ataqueEspada = -2;

public float Money = 150f;

public bool irALaDerecha = false;

// Use this for initialization

void Start()
{

Debug.Log(“=================================================================”);
CalculadoraSuma(2, 5);
Debug.Log(“=================================================================”);

if (irALaDerecha)
{
Debug.Log(“encuentras un tesoro”);

}
else
{

Debug.Log(“encuentras un mounstruo”);

}
}
}
// Update is called once per frame

void Update()
{

void CalculadoraSuma(int numero1 , int numero2) {

int suma = numero1 + numero2;

Debug.Log(suma);

}

}

Great philosophical question. What is the error what is the feature?

BTW, if you want help, please edit your subject, put something meaningful there, put your code into code tags and summarize what’s happening, what’s the problem and what have you tried to fix it. Also keep in mind that these forums are English-speaking so apart from a few people, we won’t understand your non-English variable names, strings and comments. Ok, I understand the “numero” and the CalculadoraSumma.

1 Like

go to the right is irALaDerecha

if you do not understand the name some variable ask me

Try this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class personaje : MonoBehaviour
{
    public string playerName = "Andriu";
    public string playerHeight = "UnMetroSetenta";
    public int playerSpeed = 3;
    public int playerLife = 10;
    public int ataqueEspada = -2;
    public float Money = 150f;
    public bool irALaDerecha = false;

    // Use this for initialization
    void Start()
    {
        Debug.Log("=================================================================");
        CalculadoraSuma(2, 5);
        Debug.Log("=================================================================");

        if (irALaDerecha)
        {
            Debug.Log("encuentras un tesoro");
        }
        else
        {
            Debug.Log("encuentras un mounstruo");
        }
    }

    void CalculadoraSuma(int numero1, int numero2)
    {
        int suma = numero1 + numero2;
        Debug.Log(suma);
    }

    // Update is called once per frame
    void Update()
    {
    }
}

Gracias ahora no recibo ningún error.