Page 1 of 1

putting my own char into the sfsislanddemo goes wrong

Posted: 02 Jul 2009, 14:01
by tigs
I have tried to replace lerpz with my own char which i have built and animated with biped in 3dsmax 2009. im my attempt to make it as simple as possable i created the char and called the skin Lerpz and named the the bip01 to rootJoint in the same way as lerps. I put three anims on it, idle, walk and jump and set idle as anim. put the my original lerpz in the hierarchy i put the network transform reciever on and the animation sync script. made a prefab in the project paine and named it remotePlayer and copyed my fully scripted lerpz back to the remotePlayer prefab.

i then deleted the game object from the hierachy. I deleted the original sfs_lerpz and remotePlayer, saved it, closed the programme opened it agin (cos sometimes it goes funny if i dont) I then did a build and run. loaded the game in unity3d as normal then ran the web based client and just after logging in Unity gave the error

NUllReferanceExecption: The prefab you want to instantiate is Null

and no remote player is instantiated!!!!!

can anyone tell me what i did wrong cos for the life of me i cant see anything different.


Posted: 02 Jul 2009, 14:52
by tigs
i just looked further into that error and it doesnt help much do it, :)

Posted: 03 Jul 2009, 10:34
by ThomasLund
Here is my guess on what you need to do.

In general when you delete a prefab or gameobject that is linked to from somewhere else, then that link disappears automatically.

So when you deleted the old remote player prefab, links to it got broken, and you are missing to recreate the link to the new player prefab. Simply renaming doesnt work.

You need to find where it is linked to and drag the prefab onto it.

The console error message should give you an idea from where its trying to be linked - and then you need to find that object and drag your new remote player to it.


Posted: 05 Jul 2009, 07:27
by tigs
Hi Thomas
thanks for your help on this. Im not sure what you mean by "link".

Posted: 05 Jul 2009, 07:33
by ThomasLund
Dragging prefabs/object into the inspector into public variables of a game objects components.

Posted: 05 Jul 2009, 10:20
by tigs
ah ok. right i need to read that agian then. thanks Thomas for your support on this i realy appreciate it.

Posted: 06 Jul 2009, 12:14
by tigs
Hi Thomas

many thanks for you help i have found the variables that were required. if anyone else is interested i lay out the process below.

1: I created my charicture in 3ds max and animated it with a biped.

2: i renamed the bip01 as rootJoiont. (not sure if this matters)

3: So that i could have a referance point i renamed the original remotePlayer as remotePlayer1 and the original Lerpz as Lerpz1

4: i imported the max file which i called lerpz but in retrospect i dont think it matters either.

5: I then dropped my Lerpz into the hierarchey and added the networkTransformReceiver, the animationSynhronizer, the BubblePopup and the linked the skin to the bubblePopup.

6: i then made a prefab and called it remotePlayer and added my lerpz gameObject to the prefab.

7: I next selected the NetworkController in the hierarchey and changed the variable Remote Player Prefab in the Player Spawn Controller Script to the one i created "remotePlayer". (you should see that after changeing the name of it to remotePlayer1 it inherited that name)

8: select the sfsclient in the project window and do the same in there.

now build and run to test. you should see both players as the mesh you created.