smartfox unity API

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

Moderators: Lapo, Bax

appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

smartfox unity API

Postby appels » 16 Oct 2010, 02:34

Hi,

I have an error and i'm unable to find what's causing it.

The error is :

NullReferenceException: Object reference not set to an instance of an object
NetworkTransformSender.ForceSendTransform () (at Assets/Scripts/NetworkTransformSender.cs:41)
UnityEngine.GameObject:SendMessage(String)
GetVars:ForceSendTransform(SFSObject) (at Assets/Scripts/GetVars.cs:113)
GetVars:OnObjectReceived(SFSObject, User) (at Assets/Scripts/GetVars.cs:94)
SmartFoxClientAPI.SmartFoxClient:_DispatchEvent(SFSEvent)
SmartFoxClientAPI.SmartFoxClient:ProcessEventQueue()
GetVars:FixedUpdate() (at Assets/Scripts/GetVars.cs:48)


and it hits on :

Code: Select all

//This method is called when remote user forces us to send our transform
void ForceSendTransform() {
   lastState.DoSend();
}


in the NetworkTransformSender.cs

All seems to work, i see all players and they are able to move and the animation are sent over the server.
Anyone have an idea ?

Eddy.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 16 Oct 2010, 05:56

Only thing that can be wrong is that the lastState variable at some point in time is null.

So whats causing that? Thats the question to answer - and not solveable from here without looking at your code.

Quick hack to remove the error is obviosuly to replace with if (lastState) lastState.DoSend();

Doesnt solve your null, but removed the error message
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Postby appels » 17 Oct 2010, 04:42

The error is gone now, never found what it was.
Uploaded a demo :

http://www.edje.net/AniLand/

using user variables now for avatar texture sync but i'll probably change it back to an extension.
But for now it's ok lol
Thanks for the help :)
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 17 Oct 2010, 08:29

Super
agrios
Posts: 18
Joined: 20 Oct 2010, 20:42

Postby agrios » 16 Dec 2010, 18:56

appels wrote:Uploaded a demo :

http://www.edje.net/AniLand/


where is it appels?
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Postby appels » 16 Dec 2010, 20:50

that post is 2 months old...
http://www.edje.net/AniLand2/
user test1 pass test1
agrios
Posts: 18
Joined: 20 Oct 2010, 20:42

Postby agrios » 16 Dec 2010, 20:56

yeah I am roughly two months behind :)
Is it running on Smartfox X2?

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 16 guests