is there any freeze function to stop the screen from moving when soemthing is trigger? (example, upon collision with the GUI, stop the screen from moving)
depending on what you mean by freezing screen… If you want your camera not to turn you need to disable the cameras control script. If you want everything to freeze just pause the game.
okay thanks, i wanted to freeze the whole screen when the gui window is open. using time.timescale = 0? But then how i apply the scripts below? if the gui open window, Time.timeScale = 0;?
var windowOpen : boolean = true;
var windowOpen1 : boolean = true;
var windowOpen2 : boolean = true;
var windowOpen3 : boolean = true;
var windowRect : Rect = Rect (20, 20, 120, 120);
function OnGUI () {
if (windowOpen) {
windowRect = GUI.Window (0, windowRect, WindowFunction, “My Window”);
}
if (windowOpen1) {
windowRect = GUI.Window (1, windowRect, WindowFunction1, “My Window1”);
}
if (windowOpen2) {
windowRect = GUI.Window (2, windowRect, WindowFunction2, “My Window2”);
}
if (windowOpen3) {
windowRect = GUI.Window (3, windowRect, WindowFunction3, “My Window3”);
}
}
function WindowFunction (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen = false;
counter.counter ++;
}
}
function WindowFunction1 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen1 = false;
counter.counter ++;
}
}
function WindowFunction2 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen2 = false;
counter.counter ++;
}
}
function WindowFunction3 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen3 = false;
counter.counter ++;
}
}
okay thanks, i wanted to freeze the whole screen when the gui window is open. using time.timescale = 0? But then how i apply the scripts below? if the gui open window, Time.timeScale = 0;?
var windowOpen : boolean = true;
var windowOpen1 : boolean = true;
var windowOpen2 : boolean = true;
var windowOpen3 : boolean = true;
var windowRect : Rect = Rect (20, 20, 120, 120);
function OnGUI () {
if (windowOpen) {
windowRect = GUI.Window (0, windowRect, WindowFunction, “My Window”);
}
if (windowOpen1) {
windowRect = GUI.Window (1, windowRect, WindowFunction1, “My Window1”);
}
if (windowOpen2) {
windowRect = GUI.Window (2, windowRect, WindowFunction2, “My Window2”);
}
if (windowOpen3) {
windowRect = GUI.Window (3, windowRect, WindowFunction3, “My Window3”);
}
}
function WindowFunction (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen = false;
counter.counter ++;
}
}
function WindowFunction1 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen1 = false;
counter.counter ++;
}
}
function WindowFunction2 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen2 = false;
counter.counter ++;
}
}
function WindowFunction3 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen3 = false;
counter.counter ++;
}
}
okay thanks, i wanted to freeze the whole screen when the gui window is open. using time.timescale = 0? But then how i apply the scripts below? if the gui open window, Time.timeScale = 0;?
var windowOpen : boolean = true;
var windowOpen1 : boolean = true;
var windowOpen2 : boolean = true;
var windowOpen3 : boolean = true;
var windowRect : Rect = Rect (20, 20, 120, 120);
function OnGUI () {
if (windowOpen) {
windowRect = GUI.Window (0, windowRect, WindowFunction, “My Window”);
}
if (windowOpen1) {
windowRect = GUI.Window (1, windowRect, WindowFunction1, “My Window1”);
}
if (windowOpen2) {
windowRect = GUI.Window (2, windowRect, WindowFunction2, “My Window2”);
}
if (windowOpen3) {
windowRect = GUI.Window (3, windowRect, WindowFunction3, “My Window3”);
}
}
function WindowFunction (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen = false;
counter.counter ++;
}
}
function WindowFunction1 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen1 = false;
counter.counter ++;
}
}
function WindowFunction2 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen2 = false;
counter.counter ++;
}
}
function WindowFunction3 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen3 = false;
counter.counter ++;
}
}
okay thanks, i wanted to freeze the whole screen when the gui window is open. using time.timescale = 0? But then how i apply the scripts below? if the gui open window, Time.timeScale = 0;?
var windowOpen : boolean = true;
var windowOpen1 : boolean = true;
var windowOpen2 : boolean = true;
var windowOpen3 : boolean = true;
var windowRect : Rect = Rect (20, 20, 120, 120);
function OnGUI () {
if (windowOpen) {
windowRect = GUI.Window (0, windowRect, WindowFunction, “My Window”);
}
if (windowOpen1) {
windowRect = GUI.Window (1, windowRect, WindowFunction1, “My Window1”);
}
if (windowOpen2) {
windowRect = GUI.Window (2, windowRect, WindowFunction2, “My Window2”);
}
if (windowOpen3) {
windowRect = GUI.Window (3, windowRect, WindowFunction3, “My Window3”);
}
}
function WindowFunction (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen = false;
counter.counter ++;
}
}
function WindowFunction1 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen1 = false;
counter.counter ++;
}
}
function WindowFunction2 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen2 = false;
counter.counter ++;
}
}
function WindowFunction3 (windowID : int) {
// Button to close the window here
if (GUI.Button (Rect (60, 25,50, 50), “Button”)) {
windowOpen3 = false;
counter.counter ++;
}
}
Double bonus!!!.. post x 4 ![]()