[BOLT] Using two unity projects (server/client) possible?


I'm using two unity projects. The first handles as client and the second as server (looks like a "player", but is owner of all objects like a authoritative server). My idea is to strictly separate authoritative server code from client code.

I have created all assets and bolt states in both projects (they are exact copies).

My problem is: Bolt don't recognize the states of objects correct. If I instantiate the Player client-side (IPlayerState selected), the server got an error "

You are trying to access the state of [Entity [NetworkId 0-0-0-1-0-0-0-2] ClickToMoveState] as 'IPlayerState'

He is not able to recognize the state correct.

I'm wondering if bolt at all can handle two projects or should I redesign my architecture?


  • vampir26vampir26
    edited November 7
    Here is an image to explain. The object has the wrong state attached. I don't know why this happen.

    (right click->open in new tab to see full size)
  • We don't do anything special to support this setup. If you are concerned about code access on client builds, you can use C# Defines that remove server logic from the client builds or obfuscation on your code.
  • Ok, thank you!

    I will split the code in different c# files and create a separated server-scene. Then I can build the server by selecting the server scene only and same with client scenes. This should work.
Sign In or Register to comment.