Forum Discussion

Exo_Guid's avatar
Exo_Guid
MHCP Partner
1 year ago
Solved

Workaround for ImageBinding in Array

I have some non-interactive CUIs prefabs (instances) running the same script and am swapping an image from an array.  It was working fine until I had to make the bindings private. Array: const...
  • Exo_Guid's avatar
    1 year ago

    I figured it out.

    I created private bindings, removed the index variable and replaced it with the getPlayervariable.

     private imageBinding = new Binding(images[0]);

     

    new method for updating the binding

    this.myimageBinding.set(images[(persistentStorage.getPlayerVariable<number>(player, "MYPPID")) % images.length]);