Hi! Weâre trying to get Needle to work in a Next.js project, but GameObject.findObjectsOfType(MyScript) is not working the way I expect. We have two script files â letâs say MyScript.ts and MyOtherScript.ts. When I call the method above in react it returns a single instance in dev and in when I build it, it returns two.
This leaves all function calls that I have set up to fail in production. Anyone encoutered this before?
Thanks for getting back to me. The two objects are from two different classes. I can see that when I console log them. But I import MyScript inside MyOtherScript. Maybe this can cause the error?
Sure! Iâm calling the method from a function in a React context. Any calls on this script class instance fails in production because setVisible is undefined.