Multiple controllers
Hi Guys
I'm creating a lens where you tap on the different products and it changes the colour of the hair. It works fine the first time, but thereafter gets stuck on one hair colour. I just duplicated the hair color controller and applied a behavior script to each to enable and disable it.
Is the reason why it is not working because I used 3 controllers? How would one approach this differently?
Thanks! :)
Hey Tanya,
You can watch our latest Twitch Stream which we show how to have multiple controller as well as mixing the templates together.
You can find the stream here:
https://www.twitch.tv/videos/511162036
Let me know if you still have problem with your project.
Cheers,
Amir.
Hi Amir
Thank you for linking me through to the twitch stream. With the hair color template I'm still not sure what else I should be doing so that it continues to change. I feel like I am missing a step.
I now have 3 different controllers in my Objects panel. I then linked these controllers to their own controller in the Resources panel. Should I then duplicate the hair color provider for each color? I have tried both options and it seems to be sending me down a rabbit hole of problems. The hair color still changes for the first tap on the cans but thereafter stays stuck on one hair color.
Hi Tanya,
I made a sample project with two buttons that you can use!
Basically you need to re-run this part of HairController code on every tap, because that's where it tells HairColorProvider which settings to use.
I've wrapped it in separate function so it can be called using script.api on Tap from another script.
Also no need to duplicate HairController.js or HairController object in this case. Just duplicate as many Scene Objects as you need.