abhishek4693 Posted January 21, 2020 Share Posted January 21, 2020 I have tried to change the texture of SimpleRope mesh by mesh.texture = "new texture" at run time... But it's not changing. Even I have tried by mesh.material.texture as well. Both didn't work for me. Can anyone please help? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 21, 2020 Share Posted January 21, 2020 it should work. Maybe something wrong with your new texture? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 21, 2020 Share Posted January 21, 2020 (edited) Here, I'm changing strip texture to WHITE and back on click: https://www.pixiplayground.com/#/edit/yMxrmJL59TO_H9zyKvDsf Edited January 21, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
abhishek4693 Posted January 22, 2020 Author Share Posted January 22, 2020 (edited) I have a JSON file generated by Texture Packer. I'm getting texture from JSON file and trying to change it then It's not working. I'm doing something like this: this._paylineAnimation = new SkinFiriLottoSimpleRope(this._animationFrames[0].texture, this._points); then with tween I'm changing the texture of this._paylineAnimation. this._paylineAnimation.texture = this._animationFrames[this._frame].texture; Edited January 22, 2020 by abhishek4693 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 22, 2020 Share Posted January 22, 2020 you can set breakpoint in texture setter with condition that checks null/undefined, then you'll understand how exactly null is getting there Quote Link to comment Share on other sites More sharing options...
abhishek4693 Posted January 25, 2020 Author Share Posted January 25, 2020 Can you please explain it? As I know I have all the textures in one array and I'm loop through that so No chance to get null or undefined. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 25, 2020 Share Posted January 25, 2020 https://developers.google.com/web/tools/chrome-devtools/javascript Find out what is wrong through debugging. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.