Syncing the Kinematic Character Controller with Bolt
I managed to sync the example player character from the Kinematic Character Controller (KCC) asset. I turned off autosimulation and instead call:
KinematicCharacterSystem.Simulate(BoltNetwork.FrameDeltaTime, m, KinematicCharacterSystem.PhysicsMovers);
here m is the KinematicCharacterMotor of the player.
Although the platforms appear to be moving fine (since they are now simulating) there appears be invisible colliders that move out of sync. That means that my players can collide with movers that are not yet at that position.
I was wondering how one can tick the physicmovers (platforms) properly. Do I need to sync them with Bolt in any way - if so how?
Comments
-
Hi @Mochi ,
If the platforms have a known set of positions, maybe you can move them using theBoltNetwork.ServerTime
(https://doc-api.photonengine.com/en/bolt/current/class_photon_1_1_bolt_1_1_bolt_network.html#afea23538c09035a70990085015abca32), as this is synced clock between all peers.
There are other ways to sync, using Bolt Transform properties and so on, but there is no out-of-the-box solution for this, and we don't provide direct support to KCC, for example.
You can also take a look here: https://forum.unity.com/threads/released-kinematic-character-controller.497979/page-11#post-3465398
Here you can find documentation describing how you could integration Bolt + KCC: https://docs.google.com/document/d/1oHUoyblHA45qJ8-4OyL9IDItOvvoQT59pAfC0r4-kQc/edit
--
Ramon Melo
Photon Bolt Team0 -
Hi @ramonmelo,
thanks for sharing this. Im currently trying to integrate the KCC into my current solution, but have a problem regarding the different lifecycles of Bolt and KCC. In your document ("General Guidelines: KCC + Bolt") there is a not working Download-Link. I am able to find a solution myself, but i think it would save some time if i have access to this file. Also, the document is not up-to-date i think. E.G. "BaseCharacterController.cs" does not exist in the current version from the asset store.
Thank you in advance!
thetoeb
0 -
Hi @basket random Although there are various ways to sync, such as making use of Bolt Transform features and so on, there is no out-of-the-box solution for this problem, and we do not offer direct assistance to KCC.
0