Page 1 of 1

smartfox unity API

Posted: 16 Oct 2010, 02:34
by appels
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.

Posted: 16 Oct 2010, 05:56
by ThomasLund
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

Posted: 17 Oct 2010, 04:42
by appels
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 :)

Posted: 17 Oct 2010, 08:29
by ThomasLund
Super

Posted: 16 Dec 2010, 18:56
by agrios
appels wrote:Uploaded a demo :

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


where is it appels?

Posted: 16 Dec 2010, 20:50
by appels
that post is 2 months old...
http://www.edje.net/AniLand2/
user test1 pass test1

Posted: 16 Dec 2010, 20:56
by agrios
yeah I am roughly two months behind :)
Is it running on Smartfox X2?