- Home /
A character customization
I have some what of.a idea how to do this but I'm not sure about the GUI or how to set it up. I'm going to work on a 3d RPG game and I want to make the 2nd scene a character customization. I would like a GUI function that let's me scroll side ways to choose between several objects. This is where the problem appears. I don't know how to make a scroll GUI or a way to make a object pop up and the other object be destroyed. I absolutely hate asking for help but I need this to work...
Script should Include
1 scroll with 10 objects and a way to have this object to Cary through scenes and another script with 1 scroll with 10 scripts that will be added to the character but not all 10. Againg, I'm sorry for asking.for so much and I'm not one to all ways ask for help, and if u give me opinions then be ware that I need examples because I'm still teaching myself scripting, preferably make this in java, thank you so much and sorry...
You don't need to apologise for asking for help ;) However, it's generally a good idea to show what you've already tried. The GUI page of the manual has an example in UnityScript for a horizontal slider, so you can start with that. Read the value the slider is set to, and use that to show/hide (using renderer.enabled) the appropriate object in your scene.
To be honest, I'm scared of starting a script from blank. I have never done it before. I strongly appreciate the help and will rep port back when I'm finished testing it out if it dosnt work
a.) Right click in your Project window -> Create Javascript
b.) Go to http://docs.unity3d.com/$$anonymous$$anual/gui-Controls.html and copy the section under the heading "HorizontalSlider"
c.) Paste it into your blank script, save, and then drag the script onto an object in your scene
d.) Play your game
Get that bit working first. Then edit it a little bit at a time to get to what you really want it to do. An array of gameobjects would be a good idea that you can call gameObject[i].renderer.enabled = true; depending on the value of the slider is one approach.
I did all that straight after my comment and just read that. var hair : GameObject; var hSliderValue : float = 0.0;
function OnGUI () {
if (hSliderValue) = 1;
{
Instantiate(hair, transform.position, transform.rotation);
}
}
It dosnt work
Hi Sethhalocat try this :
function OnGUI () {
if (hSliderValue == 1) {
Instantiate(hair, transform.position, transform.rotation);
}
}
If you want to make a variable equal a value you use "=". If you want to check that a variables value equals something then you use "==". And put the whole of your compare statement in the ( ).
Hope that helps.
Your answer
![](https://koobas.hobune.stream/wayback/20220613165331im_/https://answers.unity.com/themes/thub/images/avi.jpg)