putting my own char into the sfsislanddemo goes wrong

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

tigs
Posts: 7
Joined: 25 Jun 2009, 12:43
Location: plymouth

putting my own char into the sfsislanddemo goes wrong

Postby tigs » 02 Jul 2009, 14:01

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.

tigs
tigs
Posts: 7
Joined: 25 Jun 2009, 12:43
Location: plymouth

Postby tigs » 02 Jul 2009, 14:52

i just looked further into that error and it doesnt help much do it, :)
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 03 Jul 2009, 10:34

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.

/Thomas
tigs
Posts: 7
Joined: 25 Jun 2009, 12:43
Location: plymouth

Postby tigs » 05 Jul 2009, 07:27

Hi Thomas
thanks for your help on this. Im not sure what you mean by "link".
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 05 Jul 2009, 07:33

Dragging prefabs/object into the inspector into public variables of a game objects components.
tigs
Posts: 7
Joined: 25 Jun 2009, 12:43
Location: plymouth

Postby tigs » 05 Jul 2009, 10:20

ah ok. right i need to read that agian then. thanks Thomas for your support on this i realy appreciate it.
tigs
Posts: 7
Joined: 25 Jun 2009, 12:43
Location: plymouth

Postby tigs » 06 Jul 2009, 12:14

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.

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 16 guests