Question by
janus1001 · Nov 06, 2016 at 12:46 AM ·
networkingpositionrpc
UNET Set player prefab position with a ClientRpc
Hi, What I want to do is setting a player prefab position to a position of a Vector3. My code so far:
public void NextRound()
{
RpcNextRound(someVector3);
}
[ClientRpc]
public void RpcNextRound(Vector3 position)
{
player.transform.position = position;
}
Where 'player' is a public, static GameObject, different for each client. I am getting NullReferenceException, probably it won't allow this way of referrencing the player object. Any idea how could I set player objects position? I have no idea how to reference a player object, but it is quite possible I did something wrong in code.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612100132im_/https://answers.unity.com/themes/thub/images/avi.jpg)