x


a couple of prefabs with the same script...?

I have a building prefab with a script attached. When this prefab is instantiated I add it to a list. By clicking of this object, I access the attached script:

  hbScript = queryResult.SGobjectBuilding.GetComponent<SPHealthbar>();
   hbScript.showHB();

but sometimes I get a nullreference exception. My question, is there just one script in the scene? Because with show() I wanna activate a the healthbar of this particular building

more ▼

asked Feb 17 '12 at 02:22 AM

MartinSilenus gravatar image

MartinSilenus
1 1

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

0 answers: sort oldest
Be the first one to answer this question
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:

x3317
x1250
x354

asked: Feb 17 '12 at 02:22 AM

Seen: 270 times

Last Updated: Feb 17 '12 at 02:22 AM