0 votes

I am trying to make an inventory, and each item slot is a scene made up like this.

Button
-TextureRect (Icon)
-Label

In the Button.gd, I made a gdscript export, where I just drag in a gdscript file with all the information for the item. The button then instances the script, reads the properties and changes the Label and texturerect accordingly.

In the item slot scene, dragging in the item scripts updates the button icon and label perfectly, but when I add the scene to a gridContainer, it gets messed up.

The first item in the containers icon and label are invisible, and all the items after that are completely invisible. This only happens when I change the texture of the textureRect, as commenting out that part doesn't mess it up.

Without changing texture:
enter image description here
https://imgur.com/xCaizOa

After changing texture:
enter image description here
https://imgur.com/4GdNmgd

Can someone please help?

in Engine by (35 points)
edited by

1 Answer

0 votes

It was a problem with shaders. I had been using an outline shader on the textureRect, and it was not local to scene.

by (35 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.