- Home /
Object Multiplier Script and button
Hey, I'm making an pollution simulator for a school project and I need help. I need some kind of script with an on screen controller, kinda like a HUD, that would add or remove multiple objects once button is pressed.
For example, if I pushed the button labeled land pollution, it would display the land pollution around the terrain. If I press it again, it will remove that said pollution.
I need three buttons for this, (Land, Air, and Water).
Can anyone help me or provide a script?
thanks
Answer by Berenger · Mar 25, 2012 at 09:27 PM
You need to consider the two differents parts in that problem : The GUI (the visual, the buttons etc) and everything related to your project mechanic (adding / removing pollution). I can only help with the first :
Use if( GUI.Button(...) ) to display the button and detect a clic.
Toggle a bool when the button is pressed (createPol = !createPol) and modify the pollution accordingly
Your answer
Follow this Question
Related Questions
getting the object that the running script is attached to 1 Answer
Door opener 1 Answer
Getting error BCE0024, while the constructor exists 1 Answer
Having a particle effect stick to player 0 Answers
please help 1 Answer