Error with modifying variables when function is called from button click #108
Kreezy-Studios
started this conversation in
Bugs
Replies: 2 comments 5 replies
-
It's hard to say exactly what's going on without better understanding your setup. Perhaps you could share the code (or even the whole script for more context) modifying Also, are you using a custom editor or property drawer to display the |
Beta Was this translation helpful? Give feedback.
4 replies
-
I figured it out. The "UIManager" object was being modified on the prefab I have saved live and not on the "UIManager" I have on the hierarchy Sorry for the waste of time Thank you |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry for the confusing title, but I ran into an issue that I haven't been able to fix for the past week
I have a public int testing that is set to 0 at the start of the game. I have a button that when clicked, it adds +1 to the "testing" integer.
However, I can see that within the function being called, "testing" is being modified and added to, but it doesn't change to the inspector and instead stays at 0. But, when I add to the integer outside of the function being called on button click (like Update method), the variable changes in the inspector.
Any idea how to resolve this?
Beta Was this translation helpful? Give feedback.
All reactions