x


instantiate problem on the iphone

Unity iPhone tells me this is not correct:

var KaeferPrototyp : GameObject;  // Set to a Prefab in the inspector

var realKaefer = Instantiate(KaeferPrototyp , Vector3(spawnX  , 0.1, spawnY) , transform.rotation);
    var KaeferController_Script : KaeferController = realKaefer.GetComponent(KaeferController);     // ERROR: GetComponent is not a member of UnityEngineObject
    KaeferController_Script.SetTyp(kaeferTyp);

However, this works fine on Unity 2.6 PC. I am no programmer and just a Unity beginner. Can you please explain to a dummy?

Thank you very much!

more ▼

asked Feb 25 '10 at 12:18 PM

Klaus Ullrich gravatar image

Klaus Ullrich
92 2 3 9

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

1 answer: sort newest

stupid me!

...and the solution is:

var realKaefer : GameObject = Instantiate(KaeferPrototyp , Vector3(spawnX  , 0.1, spawnY) , transform.rotation);
more ▼

answered Feb 25 '10 at 12:51 PM

Klaus Ullrich gravatar image

Klaus Ullrich
92 2 3 9

please mark you own answer as accepted :)

Mar 25 '10 at 02:29 PM KvanteTore
(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:

x2000
x1674
x4

asked: Feb 25 '10 at 12:18 PM

Seen: 1154 times

Last Updated: Feb 25 '10 at 12:18 PM