- Home /
making a cheat console?
would it be possible with GUILayout? i'm talking a cheat console like the one in TES V: Skyrim. Possible? I know how to freeze time in the background, but i'm curious on if it's possible to make a cheat console. maybe GUILayer? i have no idea please tell me if it is and please give some examples of code, too!
Answer by getyour411 · Feb 08, 2014 at 05:03 AM
Start by making something the player can type into
https://docs.unity3d.com/Documentation/ScriptReference/GUI.TextField.html
once you get that working, just take the input and match it to one your 'cheat codes'. If you have something besides a design in mind, post code/specific question.
cool! i set the text field up like in the example
using UnityEngine;
using System.Collections;
public class Example : $$anonymous$$onoBehaviour {
public string stringToEdit = "Hello World";
void OnGUI() {
stringToEdit = GUI.TextField(new Rect(10, 10, 200, 20), stringToEdit, 25);
}
}
but nothing happens when i type into the text field in-game... :(
ahh yes yes forgot to mention tried to do that already nothing happened :( makes me sad
You are clicking your mouse into the box? I tested a scene I have setup to accept user input using this
GUI.Label (new Rect(10,330, 500,35), "Name?");
pcName = GUI.TextField (new Rect (15, 355, 50, 35), pcName);
and it works fine
yeah i'm clicking the mouse in the box. i'll try your code now, though.
Answer by $$anonymous$$ · Nov 08, 2018 at 11:43 PM
Sorry for resurrecting an old thread but it still shows up on the Google front page so people mind find this useful to know:
I would recommend our new Developer Console asset for this: https://assetstore.unity.com/packages/tools/gui/developer-console-132608
It also allows you to turn any public, non-public, static or non-static method into a console command which you can invoke at runtime by simply typing it's name. This also works with parameters and allows you to specify a gameobject as the target.
It also allows you to view all debug messages in builds, including stacktraces and timestamps, and allows you to collapse duplicates much like Unity's console. It also allows you to specify a custom file to save all debug messages to in an easy to read format.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Run signed apk 2 Answers
C# Teleport Script Error 1 Answer
Writing certain values of an array into a different array 3 Answers
Cant change the depth on my map without it bugging out how do I fix this? 0 Answers