- Home /
Passing random values to a client.
In my multiplayer project, I want a prefab to spawn in a random position and head in a random direction. Now, I've used Network.Instantiate to spawn the object in a random position using the parameters and it works. The bit I'm severely struggling with is applying force to the object to get it to head in a random direction.
I can use AddForce with set Vector3 values and it's all in sync, but the moment I use random values (whether generated outside of an RPC or not), it's all random but the objects become unsynced between the client and server.
I expect my syntax is just wrong (I'm new to the whole network thing, so I'm all over the place), but my code's a bit of a mess at the moment, and it wouldn't make much sense to anyone I'm afraid (trust me). Are there at least any tips or examples on using random values over a network?