The NetworkManager instantiates a Player prefab. This is your Player Object.
In a two player game, your GameObjects exist conceptually in 3 places, and logically in 2 places. An object exists on each game client, and on the game server. If the game server is also a client, it is called a host, and it shares the GameObject with the client.
- only methods on components on the Player Object can have the [Command] attribute.
- you can only call [Command] methods from other methods on the Player Object.
It is hard to see which code is server code, and which is client code. I recommend using the [Server] and [Client] attributes liberally to add this information to the source code. When this attribute cannot be applied to a method (only NetworkBehaviours support this attribute) then add the attribute inside a comment.
The NetworkTransform does not provide interpolation when in Transform mode, only when using RigidBody mode. You will need to write this code yourself using [SyncVar].
For fast iterative development, keep the NetworkManager in your development scene, and add the NetworkManagerHUD component. Set this scene as your startup scene, then Build and Run, choose Host or Client from the GUI, then press Play in the editor, and choose Host or Client.
NetworkServer.Spawn only create an instance on the client, and sets it's transform component to match the server. You will have to do any other configuration on this object via a secondary [ClientRpc] call.
So, you've created a car prefab using WheelCollider components, and now you can apply a motorTorque to make the whole thing move along. ...
Note, the GetHashCode() method will probably return a unique ID. There is a very remote chance you will get a clashing ID. Update: After...
When you start working with threads in your Unity3D project, you will discover that many things need to be done in the main loop. For exampl...
I have built a Synthesizer for creating sound effects in Unity. It fills a similar niche to SFXR/BFXR, but aims to have more quality and ver...
I've just seen and used a brilliant ssh option. The command: sudo ssh -D localport user@externalhost will set up a local SOCKS proxy l...
Thank to Adrian Boeing I was inspired this morning to hack together a ripple shader for Unity3D. Thanks for the math Adrian. You can see t...
Possibly slightly more correct lighting. The rim light is now only applied in the direction of the sun, rather than being purely based on v...
Available on GitHub: https://github.com/simonwittber/fizzle
import csv open("output.tsv", "w").write("\n".join("\t".join(e.strip() for e in i) for i in csv.rea...
Working with multiple threads is often a necessary evil. This is how I do it safely inside a Unity3D component. There are only certain time...