Basic Entity Question

I have a moving platform that I want to simulate (it has applystate and getstate functions for this). The simulation should be ticked by the server (pressumably) and not by each client.

How can I do this in Bolt? Would I need to create a new state and sync the transform in an Attached method? In which function would I be able to call my simulation?

Comments

  • Hi @Mochi ,
    How can I do this in Bolt? Would I need to create a new state and sync the transform in an Attached method?

    Generally yes, in this case, you update the state of the Platform on the Server, and it will be forwarded to the clients.
    In which function would I be able to call my simulation?

    This is generally done on the "SimulateOwner" of the Entity, as this is a callback that is invoked only on the Owner, that can update the State of the Entity.

    Another way would be to sync the position of the platform based on the Bolt Server Clock, as shown in the Advanced Tutorial: https://github.com/BoltEngine/Bolt-Sample/blob/master/AdvancedTutorial/scripts/Environment/Elevator.cs

    --
    Ramon Melo
    Photon Bolt Team