#Rigidbody2d in PredictedObject

7 messages · Page 1 of 1 (latest)

golden hamlet
#

Hi,
I followed the guide from documentation and examples for CSP to make my 2d character move.
For movement I using rigidbody2d with dynamic body type and calculate value like this _rigidbody2D.velocity = new Vector2(moveInput.x * runSpeed, _rigidbody2D.velocity.y); .
In player prefab I use PredictedObject, where I put Rigidbody2D within same prefab and remove NetworkTransform.
It's working good on ownerClient and on server. Problem is what other clients see, they see others objects to jitter and do like a little rollbacks, for me it's look like that CSP is made also for not owner object on the other clients. What I find out also, that when I moving character on owner than I have different velocities values in rigidbody for same object on the other client. I'm using now version 2.5.9.Pro.Experimental, but already tried older version like 2.5.4 , 2.5.5 , etc.
Am I doing something wrong?

Tnaks for help 🙂

golden hamlet
#

Up?

mint flume
#

Did you setup the PO? @golden hamlet

golden hamlet
#

Yep, the player prefab have NetworkObject and PredictedObject where i put rigidbody2d. CSP is scripted same as in tutorial and examples.

#

What I found out, when I uncrease tick rate from 30 to 60 then rollback doesnt happen so much and its look so much better.

mint flume
#

hmm that should only be a problem if your frame rate was low

golden hamlet
#

For every instance I have FPS >400