- Home /
Question by
Raymond 2 · Feb 16, 2011 at 09:04 AM ·
activatedeactivate
deactivate and active object, problems
I'm having a problem with a deactivate script, it should make the object invisible at the start, and when i hit spacebar it should appear, but right now it only dissapears at start and that's all, what do i have to do??
function Start () { renderer.enabled = false; }
function update () { if (Input.GetButtonDown("Jump")) { renderer.enabled = true; }
if (Input.GetButtonUp("Jump"))
{
renderer.enabled = false;
}
}
Comment
Your answer
Follow this Question
Related Questions
What happens to the code of the Start/Awake function when I deactivate a gameobject? 1 Answer
Why does the Unity HingeJoint2D not work when enabled during play? 0 Answers
Activating things- What on earth am I doing wrong??? 2 Answers
Activating/Deactivating GameObject Problem :( 3 Answers
Deactivating and Activating a group and all it's children? 1 Answer