The question is answered, right answer was accepted
I want that a speciefied player to control a car, not all players (Network). How can I do this?
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.
Answer by phineliner · Nov 18, 2015 at 06:11 PM
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.
Answer by SilentParrotStudio · Nov 18, 2015 at 06:52 PM
I solved it, thank you anyway! I'm using Unity Networking Legacy :)
Follow this Question
Related Questions
Networking attributes through interface 0 Answers
Unity Unet Online V.S. Local 0 Answers
Increasing CCU's on UNet?? 0 Answers
Multiplayer Light Intensity Not Syncing 1 Answer
What is the purpose of the broadcast data sent/received from NetworkDiscovery? 0 Answers