The problem:
Player jitters ( no matter the smoothing option i choose) ( only on ship )
The context:
Ship uses Kinematic Rigidbody > easy to sync between clients.
Player uses Dynamic Rigidbody > the only way i found to solve jitter in singleplayer.
For multiplayer, syncing Dynamic Rigidbody was not advised to me, so currently only syncing position.
Position sync works perfectly on ground, but on ship the player jitters.
All other players’ colliders and movement scripts are disabled, so the player is not being pushed by ship physics + network simultaneously.
Video is attached.
Code:
public class NetworkCharacter : NetworkBehaviour
{
public override void OnNetworkSpawn()
{
if (!GetComponent<NetworkObject>().IsOwner)
{
GetComponent<Rigidbody>().isKinematic = true;
GetComponent<CapsuleCollider>().enabled = false;
GetComponent<PlayerMovementRigidbody>().enabled = false;
//GetComponent<Renderer>().enabled = false;
}
}
}
Player Movement & Ship Movement scripts:
https://pastebin.com/Fxn4fPBA
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.