- Home /
I keep getting errors please help this script is to make gui appear if trigger is on
var Itemname = "Oak log";
var Itemdiscription = "some something to keep chills away";
var Itemworth = "worth-100gp";
var ItemBox = 1;
var ItemBoxWidth = 300;
var ItemBoxHeight = 235;
var ItemBoxsize = 100;
var ItemBoxsize1 = 100;
var Buttonwidth = 200;
var Buttonheight = 235;
var Buttonsize = 80;
var Buttonsize1 = 25;
var Text1 = "Description";
var Buttonwidthx = 200;
var Buttonheightx = 260;
var Buttonsizex = 80;
var Buttonsize1x = 25;
var Text2 = "Drop";
var details : boolean = false;
function start(){
function OnTriggerEnter(other : Collider){
if(other.tag == "Player"){
details = true;
}
}
function OnTriggerExit(other: Collider){
if(other.tag == "Player"){
details = false;
}
}
if ( = true){
function update
}
}
function update(){
function OnGUI(){
GUI.Box(Rect(ItemBoxWidth, ItemBoxHeight, ItemBoxsize, ItemBoxsize1), Itemname);
GUI.Label (Rect (300, 24, 100, 100), Itemdiscription);
GUI.Label (Rect (75, 130, 100, 100), Itemworth);
//text color
GUI.color = Color.white;
if (GUI.Button(Rect(Buttonwidth,Buttonheight,Buttonsize,Buttonsize1), Text1));
//Button
if (GUI.Button(Rect(Buttonwidthx,Buttonheightx,Buttonsizex,Buttonsize1x), Text2));
}
}
Comment
Answer by Marksmir · Aug 08, 2013 at 04:59 PM
Dude you should start using C# so you can get official unity help. I am also in C# so can't help sorry
Your answer
![](https://koobas.hobune.stream/wayback/20220613111758im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Make it Spawn 1 Cube instead of infenity 1 Answer
GUI error scripting help! 2 Answers
Item Scripting Error 2 Answers
Setting Scroll View Width GUILayout 1 Answer