only the owner and controller can modify : "animator Parameter"

Options
imageBolt-Error" alt="" />

just try understand how to use the bolt animation following the official doc and i end with this Red error

i don't get how the attached function work is it globally shared or locally on the instance

any help would be appreciate it

Comments

  • l_TJ_l
    Options
    public override void Attached()
    {
    base.Attached();
    state.SetTransforms(state.Transform, transform);
    state.SetAnimator(GetComponent());
    state.Animator.applyRootMotion = entity.IsOwner;
    }

    void Update()
    {
    var speed = state.Speed;
    var angularSpeed = state.AngularSpeed;

    if (Input.GetKey(KeyCode.W))
    {
    speed += 0.025f;
    }
    else
    {
    speed -= 0.025f;
    }

    if (Input.GetKey(KeyCode.A))
    {
    angularSpeed -= 0.025f;
    }
    else if (Input.GetKey(KeyCode.D))
    {
    angularSpeed += 0.025f;
    }
    else
    {
    if (angularSpeed < 0)
    {
    angularSpeed += 0.025f;
    angularSpeed = Mathf.Clamp(angularSpeed, -1f, 0);
    }
    else if (angularSpeed > 0)
    {
    angularSpeed -= 0.025f;
    angularSpeed = Mathf.Clamp(angularSpeed, 0, +1f);
    }
    }

    state.Speed = Mathf.Clamp(speed, 0f, 1.5f);
    state.AngularSpeed = Mathf.Clamp(angularSpeed, -1f, +1f);
    }

    the code from the Tutorial