- Home /
Question by
Nightlord491 · Nov 03, 2012 at 04:53 AM ·
buttonmodelloaddisplay
Loading a Model
Hello all, I have my GUI screen almost set up, everything is ready except one thing. I want you to be able to press a button and for it to display a 3d model, in my case a soldier so you can pick and look at different models. I know you have to do
if(GUI.Button(Rect(1150,790,100,50), "Load"))
{
(Insert stuff here)
}
Comment
Answer by Noah-1 · Nov 03, 2012 at 04:58 AM
Next time, just do a google search ;) (you can clearly see I copied it from the reference)
var 3dModel : Transform;
if(GUI.Button(Rect(1150,790,100,50), "Load";))
{
var theClonedModel : Transform;
theClonedModel = Instantiate(3dModel,
transform.position, transform.rotation);
}
Hope it helps.
Your answer
Follow this Question
Related Questions
Displaying object with button 1 Answer
Using a model preview as a image for a button 1 Answer
Load model & animation during runtime 1 Answer
MMD How to export model and animations to Unity as 3rd person controller? 2 Answers
Best way to load a level depending on which game object is clicked 1 Answer