Me and my friend are making a multiplayer survival game and we wanted to add in a boat. We have a script attached on it(BoatMover.cs) and in the PlayerController.cs we check if the user is near a boat and parent the player to it.
In the BoatMover.cs we just check for input and add force accordingly. Everything is fine on the host and the boat is moving but on the client it’s a different story. The force is being added to the boat but something else is preventing it from moving. The sync mode on the boat is set to SyncRigidbody3D but when i change it to SyncTransform everything is working, but my boat movement is jittery and it’s not the solution to the problem. I don’t understand why this is happening and i would appreciate if you could help me.
Here is my BoatMover.cs:
if (keyPressedW)
{
rigid.AddForce(transform.right * 500 * Time.deltaTime);
}
if (keyPressedS)
{
rigid.AddForce(-transform.right * 500 * Time.deltaTime);
}
if (keyPressedD) {
rigid.AddTorque(transform.up * 200 * Time.deltaTime);
}
if (keyPressedA)
{
rigid.AddTorque(-transform.up * 200 * Time.deltaTime);
}
Thanks in advance!