Hi,
I started learning C# for Unity using Monodevelopment.
At the moment im following a tutorial and after each chapter I try out what I have learned.
So I tried and got the “not all code paths return value”
I get what the erros message is saying, but dont have a clue how to fix the code.
Here it is:
using UnityEngine;
using System.Collections;
public class Try3 : MonoBehaviour
{
public int number1 = 5;
public int number2 = 10;
public int number3 = 15;
void Start ()
{
int answer =
Addnumber(number1,number2);
DisplayResult (answer);
}
int Addnumber (int num1,int num2)
{
int result = num1 + num2;
return result;
}
int DisplayResult (int answer)
{
Debug.Log ("Your Answer is:" + answer);
}
}
I still have very little C# knowledge so it will most likely be a very noob error, but getting some interaction from Experts might help my learning process.
Thanks!