The first person to solve my problem (In my opinion, not yours) will receive one dollar. You’ll just have to trust me on that. I can’t give you the dollar if you do not have paypal.
I have tried and tried for days to get a proper answer here, so now I’m gonna have to start paying apparently. I want someone to make me a working example (A Unity Project) of using OnSerializeNetworkView. I have been trying for days to get this function to do something on the receiving end, and cannot.
Just make me a working example, and post a link where I can download it. If it actually solves my specific problem I will give you the dollar. I will PM you asking for your paypal.
One Dollar, oh my! Imagine all the things I could buy with that!
So you managed to make an unappealing offer, and also deny to everyone else the right to feel good about answering something for free because they feel like it. Well done.
If your going to pay somebody at least make it worthwhile. $20 bucks isn’t too much to ask for right? (Even $20 seems small by gaming industry standards)
1$ is pretty good for something you would normally do for free.
Now I’m offering 2$. Acid makes the community look bad because of his rudeness. Hippo is making the community look bad because of his waste of time replies.
You people are making Unity look bad. Good job. Nobody likes d-bag communities.
20$ is extreme for this. I’m not gonna pay 20$ on a forum where everyone else is getting help for free.
It’s a simple thing to ask, a working demo of OnSerializeNetworkView, it’s like <10 lines of code and a few mouse clicks to put together for anyone who knows how.
I’ve been trying for days to get this to work. It must be some tiny thing holding it back.
Ok I’ll make it even easier, I’m going to post a download link for my project files. It is 85 mb. There is almost nothing in it so you should find navigation easy.
Just look at the script “TestOnSerializeNetworkView”, that is the only script that has OnSerializeNetworkView() being used. Just tell me why it’s not working, and if that fixes it for me I’ll give you the 2$
“TestOnSerializeNetworkView” is attached to the Player prefab.
Oh, oh!! I know. i know!
You didn’t add a NetworkView component to your gameObject!!! Do I win?
Sorry, just messing with ya.
Help ME out people, please… Am I correct in saying that this function will only be called if a NetworkView component is attached to an object AND the app is connected to a running server (or is the server as the case may be)? Or is the NetworkView optional?
Going for the dollar now:
var currentHealth : int;
function OnSerializeNetworkView(stream : BitStream,
info : NetworkMessageInfo) {
Debug.Log("If you are seeing this, you are not asleep");
var health : int = 0;
if (stream.isWriting) {
health = currentHealth;
stream.Serialize(health);
} else {
stream.Serialize(health);
currentHealth = health;
}
}
…this should determine wither the problem is with the execution or the content…
Already tried that. The debug message shows. And if I put it under if(stream.isWriting) it still shows, indicating that it is actually sending the message. But if I put one under “else” it doesn’t show the debug message, indicating nothing is receiving it. Even tho I have a server and a client running and I can clearly see both characters running around on both the client and the server.
Sorry but that also doesn’t pertain to my problem. Someone should really just download my project files which I linked to and take a look at them. It’s a small project, navigation should be easy.
Just run a client and a server and test it out. There is only one place where OnSerializeNetworkView() is used and that is in the script TestOnSerializeNetworkView, which is attached to the Player prefab, which has a NetworkView attached.
On network view, set observe to the sccript in which this event is.
Sends position, rotation, rigidbody velocity and angular velocity. Remove and add variables to transfer in the same way as I have. Sending velocity is a cheap way of making the other players’ movement look smoother.
Youtube videos that I learned multipalyer from.
followed by
And readong about NetworkViews in the Script Reference and knowing how they work is really useful.