So it doesn’t matter what I do with my script, it doesn’t matter if it’s just 1 line, for ex:
Debug.Log(“Welcome to number wizard, yo”);
When I save it and press play in Unity it will show that twice in the Console. Same goes for inputs, if I press down, up, or enter key it inputs it twice. I’ve tried to look this up myself and find a solution but I can’t…
Any help would be appreciated.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberWizard : MonoBehaviour
{
// Use this for initialization
void Start()
{
int max = 1000;
int min = 19;
Debug.Log("Welcome to number wizard, yo");
Debug.Log("Pick an number, don't tell me what it is...");
Debug.Log("The highest number you can pick is: " + max);
Debug.Log("The lowest number you can pick is: " + min);
Debug.Log("Tell me if your number is higher or lower than 500");
Debug.Log("Push up = higher, Push down = lower, Push Enter if correct");
}
// Update is called once per frame
void Update()
{
//Detect when the up arrow key is pressed down
if (Input.GetKeyDown(KeyCode.UpArrow))
Debug.Log("Up Arrow key was pressed.");
//Detect when the down arrow key is pressed down
else if (Input.GetKeyDown(KeyCode.DownArrow))
Debug.Log("Down Arrow key was pressed.");
//Detect when the enter(return) arrow key is pressed down
else if (Input.GetKeyDown(KeyCode.Return))
Debug.Log("Enter key was pressed.");
}
}