AsKadir Posted February 10, 2022 Posted February 10, 2022 Hi all, I have extensive code, so I took only the issue part. There is a boolean value in my code, and I'm changing it in a timeline that I can then reverse. The value is changing, but if you open a console and open an object, you'll see it isn't. My question is, am I doing something wrong? Can you help me, please? See the Pen VwrbKOe by ChicagoJostik (@ChicagoJostik) on CodePen.
Solution OSUblake Posted February 10, 2022 Solution Posted February 10, 2022 It's working correctly. When you open the object, it's going to show the current value, not what it was at the time it logged it out. That has nothing to do with GSAP, it's just how objects work by reference in JavaScript. You can test it out yourself. let obj = { value: false }; console.log(obj); obj.value = true; console.log(obj) If you need to log the actual value, it's best to just not do the object part. console.log(mat.uniforms.myBool.value) 2 1
AsKadir Posted February 10, 2022 Author Posted February 10, 2022 @OSUblake, I didn't know it ?. Thanks a lot! 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now