Table of Contents

Class KCCPlatform

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Predicted moving platform that uses FishNet Prediction V2 for deterministic movement. Players standing on this platform receive platform velocity through KCCPlayer.

public class KCCPlatform : TickNetworkBehaviour, ISceneObject
Inheritance
Object
Component
Behaviour
MonoBehaviour
NetworkBehaviour
TickNetworkBehaviour
KCCPlatform
Implements
Inherited Members
TickNetworkBehaviour.SetTickCallbacks(TickNetworkBehaviour.TickCallback)
TickNetworkBehaviour.TimeManager_OnPreTick()
TickNetworkBehaviour.TimeManager_OnPostTick()
TickNetworkBehaviour.TimeManager_OnUpdate()
TickNetworkBehaviour.TimeManager_OnLateUpdate()
NetworkBehaviour.IsSpawned
NetworkBehaviour.ComponentIndex
NetworkBehaviour.NetworkObject
NetworkBehaviour.MAXIMUM_NETWORKBEHAVIOURS
NetworkBehaviour.UNSET_NETWORKBEHAVIOUR_ID
NetworkBehaviour.ToString()
NetworkBehaviour.Reset()
NetworkBehaviour.OnValidate()
NetworkBehaviour.IsBehaviourReconciling
NetworkBehaviour.ClearReplicateCache()
NetworkBehaviour.Reconcile_Reader<T>(PooledReader, ref T)
NetworkBehaviour.OnStartServerCalled
NetworkBehaviour.OnStartClientCalled
NetworkBehaviour.OnStopNetwork()
NetworkBehaviour.OnStartServer()
NetworkBehaviour.OnStopServer()
NetworkBehaviour.OnOwnershipServer(NetworkConnection)
NetworkBehaviour.OnSpawnServer(NetworkConnection)
NetworkBehaviour.OnDespawnServer(NetworkConnection)
NetworkBehaviour.OnStartClient()
NetworkBehaviour.OnStopClient()
NetworkBehaviour.OnOwnershipClient(NetworkConnection)
NetworkBehaviour.ClearBuffedRpcs()
NetworkBehaviour.ExcludeOwnerFromUnbufferedObserversRpcs
NetworkBehaviour.IsClientOnly
NetworkBehaviour.IsServerOnly
NetworkBehaviour.IsHost
NetworkBehaviour.IsClient
NetworkBehaviour.IsServer
NetworkBehaviour.IsDeinitializing
NetworkBehaviour.NetworkManager
NetworkBehaviour.ServerManager
NetworkBehaviour.ClientManager
NetworkBehaviour.ObserverManager
NetworkBehaviour.TransportManager
NetworkBehaviour.TimeManager
NetworkBehaviour.SceneManager
NetworkBehaviour.PredictionManager
NetworkBehaviour.RollbackManager
NetworkBehaviour.NetworkObserver
NetworkBehaviour.IsClientInitialized
NetworkBehaviour.IsClientStarted
NetworkBehaviour.IsClientOnlyInitialized
NetworkBehaviour.IsClientOnlyStarted
NetworkBehaviour.IsServerInitialized
NetworkBehaviour.IsServerStarted
NetworkBehaviour.IsServerOnlyInitialized
NetworkBehaviour.IsServerOnlyStarted
NetworkBehaviour.IsHostInitialized
NetworkBehaviour.IsHostStarted
NetworkBehaviour.IsOffline
NetworkBehaviour.IsNetworked
NetworkBehaviour.GetIsNetworked()
NetworkBehaviour.IsManagerReconciling
NetworkBehaviour.Observers
NetworkBehaviour.IsOwner
NetworkBehaviour.IsController
NetworkBehaviour.HasAuthority
NetworkBehaviour.Owner
NetworkBehaviour.OwnerId
NetworkBehaviour.ObjectId
NetworkBehaviour.LocalConnection
NetworkBehaviour.OwnerMatches(NetworkConnection)
NetworkBehaviour.Despawn(GameObject, DespawnType?)
NetworkBehaviour.Despawn(NetworkObject, DespawnType?)
NetworkBehaviour.Despawn(DespawnType?)
NetworkBehaviour.Spawn(GameObject, NetworkConnection, Scene)
NetworkBehaviour.Spawn(NetworkObject, NetworkConnection, Scene)
NetworkBehaviour.RemoveOwnership()
NetworkBehaviour.GiveOwnership(NetworkConnection)
NetworkBehaviour.GetInstance<T>()
NetworkBehaviour.TryRegisterInstance<T>(T)
NetworkBehaviour.UnregisterInstance<T>()
NetworkBehaviour.CanLog(LoggingType)
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.name
Object.hideFlags

Properties

GameObject

The Unity GameObject associated with this scene object.

public GameObject GameObject { get; }

Property Value

GameObject

ID

Unique identifier for the scene object.

public long ID { get; set; }

Property Value

long

LastCompletedTickVelocity

Velocity of the platform during its most recently completed Step(float), in world units per second. Players riding the platform read this value so the inherited platform velocity is independent of whether the player's NetworkBehaviour ticks before or after this platform within the same network tick (FishNet does not guarantee a deterministic OnTick order across separate NetworkObjects). Lag is at most one tick (acceptable for moving-platform inheritance) but the value is consistent between server and client because both compute it from the same deterministic Step(float) — the server from inside its [Replicate], a client directly from its tick.

public Vector3 LastCompletedTickVelocity { get; }

Property Value

Vector3

Methods

CreateReconcile()

Override this method to create your reconcile data, and call your reconcile method.

public override void CreateReconcile()

OnStartNetwork()

Called when the network has initialized this object. May be called for server or client but will only be called once. When as host or server this method will run before OnStartServer. When as client only the method will run before OnStartClient.

public override void OnStartNetwork()

ReadPayload(NetworkConnection, Reader)

Called before network start callbacks, but after the object is initialized with network values. This may be used to read information from predicted spawning, or simply have values set before initialization without depending on SyncTypes.

public override void ReadPayload(NetworkConnection connection, Reader reader)

Parameters

connection NetworkConnection

Connection sending the payload. When coming from the server connection.IsValid will return false.

reader Reader

Remarks

Position and goal index are the platform's whole simulation state, and they are carried here rather than by a reconcile because state forwarding is off on every object in this project. With forwarding off a scene object has no owner to send a reconcile to (Server_SendReconcileRpc returns immediately when !Owner.IsValid), so a client that arrives mid-cycle would otherwise start the platform from its authored position and run a full lap out of phase with the server, for the lifetime of the scene.

Per-tick movement needs no wire at all: Step(float) is autonomous and deterministic — MoveTowards by a fixed TimeManager.TickDelta step — and it snaps exactly onto each waypoint on arrival, so float drift is bounded within one leg and reset at every corner. Both peers run it: the server from its [Replicate], a client directly from TimeManager_OnTick, because FishNet will not invoke an ownerless, non-forwarded replicate body on a client (which is why the platform stood still on every client until the 2026-08-28 audit). Fourteen bytes once per observer, instead of a reconcile every tick to every observer.

goals is built in Awake from the authored scene position, which is identical on every peer, and Awake runs before this — so assigning the live position here cannot disturb the waypoints it was derived from.

ResetState(bool)

Resets this NetworkBehaviour so that it may be added to an object pool.

public override void ResetState(bool asServer)

Parameters

asServer bool

TimeManager_OnTick()

protected override void TimeManager_OnTick()

Remarks

The server drives the platform through the predicted PerformReplicate(ReplicateData, ReplicateState, Channel). A client cannot: with state forwarding off and no owner, FishNet's Replicate_NonAuthoritative returns before it invokes the replicate body, no reconcile is ever sent (see ReadPayload(NetworkConnection, Reader)), and this object carries no NetworkTransform — so left to the replicate the platform never moved on any client while it moved on the server, and riders diverged every tick. The client runs the same deterministic step directly, from the state the spawn payload handed it.

TryGetVelocityForTick(uint, out Vector3)

The velocity this platform produced on a specific tick.

public bool TryGetVelocityForTick(uint tick, out Vector3 velocity)

Parameters

tick uint

The tick to look up.

velocity Vector3

The velocity produced on that tick, when still held.

Returns

bool

True when the tick is still in the ring.

Remarks

A rider replaying k ticks after a reconcile needs the velocity of each replayed tick, not the platform's present one. The platform itself never replays — it has no owner and no reconcile reaches a client — so without this every replayed tick inherited one frozen value and the rider's replayed path bent at each direction reversal.

WritePayload(NetworkConnection, Writer)

Called when writing a spawn. This may be used to deliver information for predicted spawning, or simply have values set before initialization without depending on SyncTypes.

public override void WritePayload(NetworkConnection connection, Writer writer)

Parameters

connection NetworkConnection

Connection receiving the payload. When sending to the server connection.IsValid will return false.

writer Writer