- Home /
Multiplayer Rigidbody Vibration
I after hours of working on a rigid body controller i settled for a premade one. Only to find that after the jump between the typical character controller to the rigidbody controller causes a crazy vibration in all the other clients that the player sees. Im almost positive that it has something to do with updating the physics over the network and having two slightly different variables being sent so the players "skip" between the two slightly (or sometimes greatly) different positions.
i came up with a quick and dirty way of sweeping my problem under the rug. On the client i set the objects to kinematic but the server still registers their physics so physics can still move them around just no other player can push them.
This is a real problem. If you use the solution that is optimal for movement, the character controller, you don't have physics between characte controllers. They won't push each other in the same manner, but you'll have a better structure to move your players. In the end, the network can't keep up with the physics output. You could test using the 'Unreliable' option for networkView, but it would not really solve the initial issue.
Answer by ScroodgeM · Aug 09, 2012 at 10:28 PM
this is caused by character controller sets its position every frame, but rigidbody has a speed and tries to move an object. so at some time you got case where speed is high and it moves object in frame, and character controller returns object back.
solution: if you use character controller, disable rigidbody or make it kinematic. you need to do this on server and clients.
and why do need rigidbodies on character controller?
oh sorry i didnt explain well i have no character controller. i have a rigid body that has a script that acts as a character controller but i think i fixed it… i made it so that if player.networkView.is$$anonymous$$ine == false then i set the object to kinematic. but thank you for your answer :)
Answer by sman_47o · Aug 14, 2012 at 06:45 PM
Ok so i fixed the problem. Any player object that isn't the client is seen as kinematic on the client. This means that wile the client cannot move the other player, physics registered on the server which sees all players as rigidbodies is applied. This just stops there from being two input sources for one object therefor one object cannot have two positions on the server and the jitter went away.
Your answer
Follow this Question
Related Questions
Network Vibration Problem 1 Answer
NetworkView Control 2 Answers
rigidbody vibration 0 Answers
Few questions regarding multiplayer! 1 Answer
Reducing lag in networking. 1 Answer