Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Enabling ItemImage and QtyText #35

Open
Gizmocow501 opened this issue Aug 7, 2020 · 2 comments
Open

Issue with Enabling ItemImage and QtyText #35

Gizmocow501 opened this issue Aug 7, 2020 · 2 comments

Comments

@Gizmocow501
Copy link

I'm currently on Chapter 6 and I've run into a issue. I can't seem to figure out why this is happening, but when I run the game,
Capture
Capture1
Capture-1
Capture-2

the ItemImage and QtyText (even when interacting with multiple coins) is still disabled on all five slots. To ensure that this issue is not with the code of my inventory, player, character, or any other script that was altered this chapter or the last, I have copied and pasted the code from this website. I know for sure that the coin sprite is being added and the code is being activated because I used a print out test in the console. Additionally, I enabled both the ItemImage and QtyText manually by dragging the prefab onto the scene view and using the override button to change all instances. Doing that allowed me to visually see that the coin is being added and the text is being changed. So, after all of this I am truly stumped as to what could be causing the issue. I have included screenshots of what the ItemImage/QtyText looks like with it enabled and disabled. Any attempts at helping me would be much appreciated. I am going to save my progress desperately and continue on with the book, so I can come back to this issue if/when anyone figures out what I am doing incorrectly.

@ravinem1
Copy link

ravinem1 commented Sep 7, 2020

Ya it doesn't work if we enable image/Text per se. What we need to do is to enable the gameObject itself.
Changes to make it work:

  1. Instead of 'quantityText.enabled=True', write 'quantityText.gameObject.SetActive(true);'
  2. Instead of 'itemImages[i].enabled=True;', write 'itemImages[i].gameObject.SetActive(true);'

@ghost
Copy link

ghost commented Aug 26, 2021

the checkbox to disable the ItemImage and QtyText is display the image below
image

And you will have the example like the book. Have fun 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants