I know this might seem trivial, but I couldn't find it anywhere, so how would I script for a gui texture change in position after I click on it.
That depends on the kind of motion, but the general idea is simple
If you define the rect as so (100 being an example size, do whatever you like):
new Rect(x,y,100,100);
Then you can have instance variables elsewhere in the code what change the position of whatever uses that rect. Changing these variables changes the position of the texture.
You can then call
x += 100*Time.deltaTime
This will make the button move right by 100 pixels each second.
EDIT: Example code:
c#
public class ByeByeButton : Monobenaviour
{
public int x;
public int y;
public bool gone = false;
public void OnGUI()
{
if (GUI.Button(new Rect(x,y,100,100),"Click me and watch me whoosh!"))
{
gone = true;
}
if (gone)
{
x += Time.deltaTime * 100;
y = x;
}
}
}
JS:
var x : int;
var y : int;
var gone : bool = false;
public function OnGUI()
{
if (GUI.Button(new Rect(x,y,100,100),"Click me and watch me whoosh!"))
{
gone = true;
}
if (gone)
{
x += Time.deltaTime * 100;
y = x;
}
}