I want that a speciefied player to control a car, not all players (Network). How can I do this?
I have a car with “Enter/Exit” script, so, I want that player to control the car, not the others. Just one player to control the car.
If you are using UNET / Networkbehaviour on your car script, you can filter the input handling by isLocalPlayer
.
Example:
public class Car : NetworkBehaviour {
void Update ()
{
if (!isLocalPlayer ) {
return;
}
// input handling for local car only
int carX = moveX;
int carY = moveY;
}
}
See Scripting API.
I solved it, thank you anyway! I’m using Unity Networking Legacy