#Rigidbody prediction

16 messages · Page 1 of 1 (latest)

fiery vault
#

Hey. I am trying to move an object by walking into it. I cant get the client to predict the object that the player is moving into. How can this be obtained. The video is the client and the image is the object that the player is trying to push.

swift plinth
#

Hi there, I notice you have a NetworkTransform on the object as well as state forwarding, which shouldn't be the case

fiery vault
#

Yeah i saw that in an other thread after posting this. But its still the same

swift plinth
#

What does the code look like for the object?

fiery vault
#

Nothign on the object being pushed

swift plinth
#

It needs prediction code

fiery vault
#

Alright. Thanks i will try thaty

fiery vault
#

So i implemented it on the object but get the same result. The networktransfrom is disabled and it using State Forwarding. Should the player itself do anything special? I tried implementing the PredictionRigidbody in the player reconcile like the object but also the same.

swift plinth
#

I've just tried the script in the docs and this simple setup and it's working in the demo.

fiery vault
swift plinth
#

Looks like the jitter is from the player script instead of the cube, no?

fiery vault
#

Now i made it with rigidbody.MovePosition and its a lot better but every time i stop moving its misbehaving

#

Fixed it by checking if the move vector was not zero

fiery vault
#

Hey. I changed it to use the PredictionRigidbody.Velocity() to move it. But i still get the jitter when ending the input. I tried applying force using AddForce like in the demo but its the same on the client even with no latency.

fiery vault
#

Fixed by running CreateReconcile OnPostTick. The demo does it OnTick but the docs says PostTick