x


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;
    }
}
more ▼

asked Feb 16 '11 at 09:04 AM

Raymond 2 gravatar image

Raymond 2
119 37 40 45

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Solved it, update had to be Update

more ▼

answered Feb 16 '11 at 09:42 AM

Raymond 2 gravatar image

Raymond 2
119 37 40 45

(comments are locked)
10|3000 characters needed characters left

use the function declartion properly function Update beacuse of that start function only works

more ▼

answered Feb 16 '11 at 08:22 PM

robert 1 gravatar image

robert 1
23 9 10 14

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x79
x40

asked: Feb 16 '11 at 09:04 AM

Seen: 1136 times

Last Updated: Feb 16 '11 at 09:04 AM