Odd Movment Affect

So whenever I use this script on my multyplayer game it seams when someone moves it moves the other players too. Any ideas how to fix? I tried it useing the “player” var and without it. Player is themself.

var projectile: Transform;

var gun : Transform;

var player : Transform;

 

function Start () {

 

}

 

function Update () {

 

 if (Input.GetKey(KeyCode.W)){

    player.Translate(Vector3.forward * Time.deltaTime * 2);

        }

        if (Input.GetKey (KeyCode.A)){

 player.Translate(Vector3.left * Time.deltaTime * 2);

        }

        if (Input.GetKey (KeyCode.S)){

    player.Translate(Vector3.back * Time.deltaTime * 2);

        }

        if (Input.GetKey (KeyCode.D)){

 player.Translate(Vector3.right* Time.deltaTime * 2);

        }

        

        

    

    }

}

Is that attached to all Player objects?

If so, each one is polling for key presses and applying movement. You need this to be attached to only the GameObject you want to have listening for movement on the local machine.

The game object is instated. How could I make it unique for that player?

Pull whole code in condition:

if(networkView.isMine) {

}

By the way, code is terrible. Use axis inputs like in default character controller script.

ohh thanks. I got it working and it works realy smoothly now, but you control the other person instead of yourself, any ideas? I want you just to be abel to control your own character, not the other if you get what I mean.(Im useing 2 different computers for testing)

Any ideas? Like I said now you just control the other player… not yourself.