More authoritative problems

I know this has been asked a lot in various ways but I read those I could find and didn't find a solution. So I tried to combine the first parts of the basic tutorial and chapter 3 of the advanced tutorial to make the advanced part simpler. What I have now are moving cubes using the ExecuteCommand method but the client does not care about walls or anything "planted" by the server.

Example (client inside the wall - the wall was placed at runtime in the editor, just like in the video in chapter 3)

My command and state look like this
(Command)

(State)

And then there is the code. (Sorry for the bad formatting)
(CubeBehaviour)
hastebin.com/otoriraxuk.avrasm
(CubeMotor)
hastebin.com/falemokumi.avrasm

I hope someone will take a look at this.
I use version 0.4.3.10 of Bolt by the way.

Comments

  • A lot of things are wrong with this. Just a few things I spotted.

    void Awake() {
    _motor = GameObject.FindObjectOfType();
    }

    Why would you do FindObjecOfType ? You do realize there will be more then one CubeMotor in the scene right?

    Try gameObject.GetComponent();

    Not sure what you are doing down here...

    public override void Attached() {
    state.SetTransforms(state.CubeTransform, transform);
    if (entity.isOwner) {
    entity.TakeControl();
    }
    }

    It should be..

    public override void Attached() {
    state.SetTransform(transform);
    }

    The way you are assigning control is wrong. Currently you are giving the server control of all the cubes.

    I would really bunker down and read the tutorial and try to replicate it over & over.




  • Zamoht
    Zamoht
    edited December 2015
    Sorry I was too quick posting my question. I see now that I skipped a small section of the tutorial. Thanks for the answer.