- Home /
GUI HELP!!!!!
Hello everyone, this is FastMountainStudios and I need some help. I am currently making and RTS game and I need some help, the thing I need help with is how do I make a Gui Text when I click it lets me place down a certain bulding. Please help if you can, thanks
Could you please ask one question, ins$$anonymous$$d of 3? Your question won't get any more interest because it's been posted more than once.
Answer by flamy · May 29, 2012 at 11:50 AM
In this case you should be using GUI.button instead of gui text. like this
function OnGUI()
{
if(GUI.Button(Rect(10,50,100,100),"Your text",GUIStyle.none))
{
// instantiate the building and move it with mouse, on mouse click place the building at tht position.
//the script is a bit complicated to give unless i knw about the game
}
}
this would let you click the text. I hope this is what you are looking for, if not please comment your requirement below
Thank you but I need a script for my RTS (Game like age of empire) and when I click the text it spawns a building and allows me where to place it. Thanks :D
no it still doesn't let me place the building and I can't click it either. Ok about the game, it is going to be a Real Time Strategy like Age Of Empires and when I click the text or button if you want, a house that I modelled will appear on my mouse and let me place it where I want to. Thanks:D
I'm afraid you won't find someone on here to write your game for you - that's not the purpose of Unity Answers. However, you might find someone prepared to help you on the forum and I hear tell that the collaboration forum is useful http://forum.unity3d.com/forums/17-Collaboration
Your answer
Follow this Question
Related Questions
In Game player message - GUIText or something else? 1 Answer
help with Gui texts 2 Answers
I need help with my GUI text for my Real Time Strategy Game 0 Answers
Distribute terrain in zones 3 Answers
Is the GUI text still viable? 1 Answer