PredictedObject

This component only has values when using Prediction V1. The component will remain available on Prediction V2 but will not function.

A predicted object is any networked object which may be affected by client-side prediction. This could be the player object which is using client-side prediction, or an object which a player may collide into, such as a rolling ball.

PredictedObject is responsible for configuring objects, smoothing, and reconciling them when appropriate.

Component Settings

Implements Prediction Methods must be marked if the NetworkObject uses Replicate and Reconcile methods. When PredictedObject is only used to forward states and does not implement prediction methods, leave this unchecked.

Graphical Object is the object which holds the graphics for your predicted object. When using client-side prediction all predicted objects must have their graphics as a child of the predicted object. For example, if your rigidbody and collider are on root, the graphics must remain beneath root and set as the graphical object.

Enable Teleport will allow the graphical object to teleport to it's actual position, also known as the root position, if the position changes are drastic. Ideally you will not need this setting but it's an option should you choose.

When Enable Teleport is true

Teleport Threshold is shown while teleporting is enabled. If the graphical object's position is this value in units from the actual position the graphical object will teleport to the actual position.

Owner Settings

  • Smooth Position while true will smooth position changes.

  • Smooth Rotation while true will smooth position changes.

  • Interpolation is how many ticks the graphical object should buffer before being updated. This value does not affect the rigidbody object; it remains in real-time.

Prediction Type is to determine if you are using rigidbodies or not for the predicted object. For example, if you were updating your transform with a CharacterController component this would be set to Other. If you were using rigidbodies you would choose Rigidbody or Rigidbody2D.

When Prediction Type is Rigidbody/Rigidbody2D

Rigidbody/Rigidbody2D is displayed when not using a rigidbody Prediction Type. You must specify the rigidbody on your root object within this field.

Spectator Settings

  • Smoothing

    • Smooth Position will modify the graphical objects position when true. While false the graphical object will not have its position updated and you must manage it manually.

    • Smooth Rotation will modify the graphical objects rotation when true. While false the graphical object will not have its rotation updated and you must manage it manually

    • Smoothing Type adaptively determines how a client will smooth the spectated object. Values range from precision to smoothness, where precision will favor more accurate collisions for fast paced games, and smoothness prefers graphics be smooth rather than abrupt corrections.

  • Maintained Velocity retains a percentage of lost velocity between simulations. This can be useful if an object has a lot of drag but you expect it to keep velocity on the server. Positive values will result in more velocity while lowers will result in less. A value of 1f will prevent any velocity from being lost between ticks, unless indicated by the server.

  • Resend Type determines how data will be resent to help prevent client-side de-synchronizations. Generally leaving this disabled will provide desirable results.

    • Interval is how often to resend data when using the Interval resend type. Lower intervals will send the data more often.

When PredictionType is Other

Network Transform is required when rigidbodies are not used. A NetworkTransform component must be added to the root to synchronize the transform changes to others. PredictedObject will automatically configure the NetworkTransform after you specify it within this field.

Last updated